What are filters? and how many types of filters are there
in ruby
Answers were Sorted based on User's Feedback
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 |
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 |
What role do sub-directory app/helpers and app/controllers play?
Explain me what is the naming convention in rails?
Tell us what is the difference between redirect and render in ruby on rails?
What do you understand by rails migration and what it can do?
What are the various changes between the rails version 2 and 3?
Who developed ruby on rails?
who developed rails?
what are helpers and how to use helpers in ror?
What is the use of the super function in ruby on rails?
How to find second max element from database ?
what is different between activerecord::relation's count, length and size methods?
what is the purpose of the resources method in the code snippet below?