Re: [Rails] before_action for only one action

2016-01-28 Thread Martin
Hi tamouse, tamouse pontiki writes: >> Is there another way doing that? Or is this the recommend way? > > If you want it for only one action, Jay call it in the action. I tried it, but I have a view, so interesting that it doesn't work, because they have a redirect_to inside. If I put it in

Re: [Rails] before_action for only one action

2016-01-27 Thread tamouse pontiki
On Jan 27, 2016 1:13 PM, "Martin" wrote: > > Hi there, > > If I want a before_action for only one action, like > > before_action check_something_with_redirect_if_any, only: :index > > Is there another way doing that? Or is this the recommend way? If you want it for only one

[Rails] before_action for only one action

2016-01-27 Thread Martin
Hi there, If I want a before_action for only one action, like before_action check_something_with_redirect_if_any, only: :index Is there another way doing that? Or is this the recommend way? If not what else could work here? Thanks, Martin -- You received this message because you are

Re: [Rails] before_action for only one action

2016-01-27 Thread Karthikeyan A K
You can put like this before_action check_something_with_redirect_if_any, except: [all actions except index] but its very verbose :D On Thu, Jan 28, 2016 at 12:43 AM, Martin wrote: > Hi there, > > If I want a before_action for only one action, like > > before_action