MainController implies main.rhtml, which will automatically have access to the methods inside MainHelper (in \app\helpers\main_helper.rb). Should not the partial templates called from main.rhtml via <%= render :partial => ''partial'' %> also have access to the methods in main_helper ? I have tried <% display_dates = create_display_dates(@events) %> and <% display_dates = MainHelper::create_display_dates(@events) %> and both report "undefined method `create_display_dates'' ..." Do I misunderstand the nature of helper scoping ? -- Posted via http://www.ruby-forum.com/.
Richard Haven wrote:> MainController implies main.rhtml, which will automatically have access > to the methods inside MainHelper (in \app\helpers\main_helper.rb). > > Should not the partial templates called from main.rhtml via <%= render > :partial => ''partial'' %> also have access to the methods in main_helper > ?Hi, I believe you need to put the helper code in the application helper if you want access by the partials. -- Posted via http://www.ruby-forum.com/.