Copying controller methods to helpers.

In your ApplicationController:

helper_method :can_view?, :can_modify?

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?

Hemant-

  You could store all of those methods in a module name WhateverModule. Then just include that in yoru controller and view helpers and it will bve shared without all the ugly helper calls:

module WhateverModule
   def some_methods
   end
end

class ApplicationController < ...
    include WhateverModule
end

module ApplicationHelper
   include WhateverModule
end

Cheers-
-- Ezra Zygmuntowicz-- Lead Rails Evangelist
-- ez@engineyard.com
-- Engine Yard, Serious Rails Hosting
-- (866) 518-YARD (9273)

Hmm makes sense.

Thanks.