Module: ActionControllerExtensions
- Defined in:
- lib/before_or_404/action_controller_extensions.rb
Instance Method Summary collapse
- #before_or_404(*names, &blk) ⇒ Object
- #prepend_before_or_404(*names, &blk) ⇒ Object
- #skip_before_or_404(*names, &blk) ⇒ Object
Instance Method Details
#before_or_404(*names, &blk) ⇒ Object
2 3 4 5 6 |
# File 'lib/before_or_404/action_controller_extensions.rb', line 2 def before_or_404(*names, &blk) _insert_callbacks(names, blk) do |name, | set_callback :process_action, :before, wrapper_for(name).method, end end |
#prepend_before_or_404(*names, &blk) ⇒ Object
8 9 10 11 12 |
# File 'lib/before_or_404/action_controller_extensions.rb', line 8 def prepend_before_or_404(*names, &blk) _insert_callbacks(names, blk) do |name, | set_callback(:process_action, :before, wrapper_for(name).method, .merge(:prepend => true)) end end |
#skip_before_or_404(*names, &blk) ⇒ Object
14 15 16 17 18 |
# File 'lib/before_or_404/action_controller_extensions.rb', line 14 def skip_before_or_404(*names, &blk) _insert_callbacks(names, blk) do |name, | skip_callback(:process_action, :before, wrapper_for(name).method, ) end end |