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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

If you want to set up a one-to-one relationship between two models, you'll need to add belongs_to to one, and has_one to the other. How do you know which is which?

445


What is the purpose of load in ruby?

484


Explain what is the role of the subdirectories app/controllers and app/helpers in rails?

486


What is ruby on rails & why it is used for?

424


Explain how does rails implement ajax?

526






what is the function of garbage collection in Ruby on Rails?

467


What is the purpose of auto_load in ruby?

494


when self.up and self.down method is used?

493


What is the naming convention for variables?

505


Explain the features of ruby on rails.

454


what are helpers and how to use helpers in ror?

524


write a program to show the usage of sql in the database file?

484


What role does garbage collection play?

503


How is dynamic scaffolding different from static scaffolding?

449


How many types of variables are available in ruby class?

484