-
-
Save addame/2522003 to your computer and use it in GitHub Desktop.
Revisions
-
Amitesh revised this gist
Apr 28, 2012 . No changes.There are no files selected for viewing
-
Amitesh created this gist
Apr 28, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,49 @@ Accessing Helper modules in rails http://www.funonrails.com/2010/12/accessing-helper-modules-in-rails.html 1. Helper methods all the time for views class ApplicationController < ActionController::Base helper :all# include all helpers, all the time for views end 2. Controller methods in views class ApplicationController < ActionController::Base helper_method :current_store #now controller_method can be accessed in views end 2. Helper methods in controller class ApplicationController < ActionController::Base include ActionView::Helpers::ApplicationHelper end 3. Helper methods in model class Student < ActiveRecord::Base include ActionView::Helpers::ApplicationHelper end 4. Helper methods in mailer class Notifier < ActionMailer::Base add_template_helper(ApplicationHelper) #... end