Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 3. Controllers > Skipping filters

3.4.4. Skipping filters

On occasion you’ll want to skip a filter that was defined in a superclass. To do this, you can use the skip_before and skip_after class methods from AbstractController:

class Application < Merb::Controller
  before :login_required

  private

  def login_required
    unless session[:user_id]
      throw :halt, Proc.new {
        |c| c.redirect url(:controller => 'sessions', :
          method => 'new')
      }
    end
						end
						end
						class Sessions < Application
  skip_before :login_required, :only => %w{ new create }
end


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial