According to what I'm reading in the docs, the before_filter
method is deprecated.
This question is two-fold: First, is that correct (It doesn't work in Rails 3, so I'm pretty sure it is) and second, what is another way to replicate that method just with using Rails/Ruby's built-in methods?
From what I can find, there isn't anyt开发者_StackOverflow社区hing like it, but I could be looking in the wrong place.
Rails 4.2's changelogs mention that all *_filter
methods are going away in favor of their *_action
counterparts.
Versions up to Rails 4.2 can use before_filter
as they please. Versions 4.2 and above should use before_action
(and friends) instead.
精彩评论