SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Jul 2009
    Posts
    220
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Rails documentation with examples? and what is before_filter?

    One thing I dislike about Rails is its documentation.
    I was watching this screencast http://railscasts.com/episodes/210-customizing-devise (at -7:00) and wanted to find out more about the before_filter.

    Taken from http://api.rubyonrails.org/classes/A...-before_filter
    before_filter(names, block)
    Append a before filter. See #_insert_callbacks for parameter details.

    Source: show | on GitHub
    This doesn't really tell me much information.
    Neither does #_insert_callbacks.
    And the syntax seems different. There are no examples too.

    How do I find out more about stuffs that I come across that I'm not sure of?
    Are there better documentation with examples?

    Can anyone tell me what type is the before_filter called, a controller method?
    How to use it, and what other possible methods (if thats what its called) there are?

  2. #2
    SitePoint Enthusiast
    Join Date
    Feb 2003
    Location
    Akron, OH, USA
    Posts
    99
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    The Rails guides are a good way to get info about things like this.

    http://guides.rubyonrails.org/action...w.html#filters

  3. #3
    SitePoint Member
    Join Date
    Mar 2013
    Posts
    16
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    with before_filter you can execute a function before an action


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •