I am using Ruby on Rails v3.0.9 and I would to use a method that works as-like the current_page?(options) method (included in the RoR
ActionView::Helpers::UrlHelper Class), , pero in my controllers. That is, I would like to check en mis controladores (not in view files) if the current "browsed" page corresponds to a RoR path (eg:
signin_path, etc ...).
Is it possible? If so, how can I accomplish that?
preguntado el 28 de agosto de 11 a las 03:08
My advice to you: if you are in need of this method in controller, than either you have ugly routes, or you have ugly code in your controller.
Better think what you can improve in your existing code to avoid using "current_page?" in controller.
Something is fundamentally wrong with an action that doesn't know what the current page is, but until we see some real code I don't think we're going to get to the bottom of that.
This Railscast should give you some ideas on building the wizard that you're after.