Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- To stop the before filter chain you use throw :halt with a few options:
- # halts the filter chain and calls filters_halted which you can override
- # in your controller to specialize it.
- throw :halt
- # halts the filters and calls the method named after the symbol:
- throw :halt, :other_action
- # halts the filter chain and returns the result of the Proc being called
- throw :halt, Proc.new{ |c| c.redirect "/foo" }
- # halts the chain and returns whatever is in the string
- throw :halt, "<h1>You don't have permissions dude!</h1>"
- or even render templates:
- throw :halt, render 'foo'
- throw :halt, partial 'foo'
Add Comment
Please, Sign In to add comment