What are filters? and how many types of filters are there
in ruby

Answers were Sorted based on User's Feedback



What are filters? and how many types of filters are there in ruby..

Answer / sanjib

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.

Is This Answer Correct ?    28 Yes 3 No

What are filters? and how many types of filters are there in ruby..

Answer / raja

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

Is This Answer Correct ?    13 Yes 4 No

Post New Answer

More Ruby on Rails Interview Questions

what is Polymorphic Association in Ruby on Rails?

0 Answers  


difference between member routes and collection routes ?

0 Answers  


Explain the various ide's of ruby on rails.

0 Answers  


what is a rails migration? Write up a short example of a simple rails migration with a table called customers, a string column called name, and a text column called description?

0 Answers  


What is rails migration? What can it do?

0 Answers  






How is the model view controller framework used in ruby on rails?

0 Answers  


Do you know what is rake in rails?

0 Answers  


What are the steps involved in writing and setting up an application in ruby on rails?

0 Answers  


How will be the future for ruby on rails?

0 Answers  


Explain rails caching levels.

0 Answers  


Explain what are the servers supported by ruby on rails?

0 Answers  


What is the directory structure of rails?

0 Answers  


Categories