Find Interview Questions for Top Companies
Ques:- What are filters? and how many types of filters are there in ruby
Asked In :-
Comments
Admin May 17, 2020

basically filters are used to run some code or skip some
code before executing particular action.It is used in
controller.say we want to check authenticity before we
executing some action or skip checking authenticity before
some action which automatically is configured to check the
authenticity.We can do it by before_filter :somemethod or
skip_before_filter :someaction inside my controller.

Admin May 17, 2020

Filters enable controllers to run shared pre and post
processing code for its actions.
Filter methods are macro-style, that is, they appear at the
top of your controller method, inside the class context,
before method definitions.
the below types of filters in ruby
before_filter,
after_filter,
prepend_before_filter,
prepend_after_filter,
around_filter

Ques:- What is the difference between sessions and flash?
Asked In :- palle technologies,
Comments
Admin May 17, 2020

Session is for the application i.e If user logs in the
session will be applied for the user.
Flash is valid from one request to other i.e if the page is
redirected from one page to other,its valid in within this
request.

Admin May 17, 2020

Session is only for store the small amount of user
data,which data not stored permanently that's when we logged
out from our application.. which session value will removed.
But Flash is used to display the some messages like error
message and useful information messsages in view pages...

Ques:- What is the architecture of Model views and controllers
Asked In :-
Ques:- what is session and cookies
Asked In :-
Comments
Admin May 17, 2020

Session is used for maintaining the particular value
throughout the session..(brower closed)
e.x: session[:value]="poornimad"
this values is not changed until the brower closed..
Cookies:
*********
This is used to store the values in the Browser..this
value is not delete till the cookies are deleted..This
cookies concept is same as Java cookies.The concept is same.

Admin May 17, 2020

Session are used to store information about user on server
side .Whereas cookies are used on client side

Ques:- Whats the difference between symbol and string?
Asked In :- Talencia LLC,
Comments
Admin May 17, 2020

Symbol refers to the same memory location where string
generates a new id every time for eg.
STRING
irb(main):019:0> "ruby".object_id
=> 24095860
irb(main):020:0> "ruby".object_id
=> 24092310
irb(main):021:0> "ruby".object_id
=> 24088760
irb(main):022:0>
SYMBOL
irb(main):022:0> :ruby.object_id
=> 102978
irb(main):023:0> :ruby.object_id
=> 102978
irb(main):024:0> :ruby.object_id
=> 102978
irb(main):025:0> :ruby.object_id
=> 102978
irb(main):026:0>

Admin May 17, 2020

Rails makes extensive use of symbols. A symbol looks like a
variable symbols name, but it’s prefixed with a colon.
Examples of symbols include :action,:line_items, and :id.
Rails uses symbols to identify things. In particular, it
uses them as keys when naming method parameters and looking
things up in hashes. For example:
redirect_to :action => "edit", :id => params[:id]

Ques:- what the difference between static scaffolding and Dynamic scaffolding?
Asked In :- Relinns Technologies,
Comments
Admin May 17, 2020

With Rails 2.0, you may have noticed that dynamic
scaffolding breaks–that is, if you have a controller with
scaffold :model_name in it, all the scaffolded actions–new,
delete, index–no longer exist! In Rails 2.0, you can only
generate static scaffolding–that is, you can use the
scaffold to generate the files for controllers, models, and
views.
What’s more, Rails 2.0 allows you to specify the model
attributes inside the scaffold. This then creates views with
all the appropriate fields, and it also creates the
migration with all the fields in it! Excellent!
As an example, say we wanted to create a blog-post model. We
could generate it like so:
script/generate scaffold Post title:string content:text
category_id:integer
You’ll notice Rails will generate, among other things:
* A post.rb model file
* A posts_controller.rb controller file
* A posts view folder containing views for the index,
show, new, and edit actions
* A DB migration called xxx_create_posts
* A unit-test, fixtures file, and helper
Everything you need–indeed, everything the dynamic
scaffolding provided–is included, albeit as static content.
All you need to do is migrate your DB and you’re up and flying!
So the main difference is, with dynamic scaffolding you can
generate new, edit and delete methods but with static
scaffolding you can't

Admin May 17, 2020

Hi,
Static scaffolding is present in rails 1.0 version with the
comand
"ruby script/server geterate scaffold Product Admin".
Here, Product is model and Admin is controller.So it (Rails
1.0)automatically generates the table column defined in
products table
CONCLUSION:SCAFFOLDING IN RAILS 1.0 TAKES TWO PARAMETERS
1.MODEL
2.CONTROLLER
While in dynamic scaffolding u need to create model and
controller one by one

Ques:- Why do we use request.xhr? in rails
Asked In :- Technologics,
Comments
Admin May 17, 2020

request.xhr? indicates the controller has
received an ajax request. It returns true or false

Ques:- difference between form_for and form_tag
Asked In :-
Comments
Admin May 17, 2020

The difference between the two is that form_tag just outputs
a <form>tag , It doesn't relies on activerecord object
and form_for gives you a means of accessing some wrapped object.

Ques:- Why RubyonRails?
Asked In :-
Comments
Admin May 17, 2020

1)for fast developing websites,
2)convention over configuration
3)scaffolding
4)pure Object oriented concepts
5)less coding
6)easy understanding of coding
7)follows MVC architecture
8)using library and gem files

Admin May 17, 2020

Super productive new way to develop web applications because:
1. Dynamically typed programming language similar to Python,
Smalltalk, and Perl(Templating language)
2. Follows Model-View-Controller (MVC) architecture
3. Strives for simplicity
4. Less coding.
5. Minimum Configuration.
6. Design patterns admire
7. Light webserver
8. ORM



The Ruby on Rails category on takluu.com is tailored for web developers and programmers preparing for interviews focused on the Ruby on Rails framework. Ruby on Rails, commonly known as RoR, is a powerful open-source web application framework written in Ruby, following the MVC architecture.

This section covers important topics such as Rails MVC components, routing, Active Record ORM, migrations, validations, callbacks, and RESTful APIs. You will also find interview questions related to Rails security best practices, testing frameworks like RSpec, and deployment strategies.

Interviewers typically ask practical questions such as:

  • “Explain the MVC pattern in Ruby on Rails.”

  • “How does Active Record simplify database interactions?”

  • “What are Rails migrations and why are they important?”

Our content breaks down complex Rails concepts into easy-to-understand explanations with code examples and real-world scenarios. Whether you’re a beginner or an experienced developer, this category helps you strengthen your knowledge and prepare confidently for interviews.

At Takluu, we regularly update the Ruby on Rails category with the latest features, security updates, and best practices to ensure you stay competitive in the fast-evolving web development field.

AmbitionBox Logo

What makes Takluu valuable for interview preparation?

1 Lakh+
Companies
6 Lakh+
Interview Questions
50K+
Job Profiles
20K+
Users