Re: Copying controller methods to helpers.

Hemant Kumar
Sun, 21 Jan 2007 19:14:37 -0000

On Sun, 2007-01-21 at 01:50 -0800, Chris Wanstrath
wrote:
> On 1/20/07, Jake Janovetz
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:
>
> > I would also like to provide these same methods to my views, but I
don''t
> > quite understand how the scope will work.
>
> In your ApplicationController:
>
> helper_method :can_view?, :can_modify?
>
> --
> Chris Wanstrath
> http://errtheblog.com
>

Ok Chris, I like helper method, but sometimes the list grows too long.

I used to have following code in my application.rb

helper_method
:current_url,:rand_between,:url_without_port,:market_open_time_in_utc,:market_close_time_in_utc,:market_current_time_in_utc,:market_local_time_as_str,:redirect_to_login,:current_domain,:diode,:triode,:pipe_val

in those cases, what would the best approach? Moving them to a plugin?