class AssigneesController < ApplicationController def assignees @assinees = Assignee.find(:all, :select => "#{params[:assignee_clean_by]}, id").uniq_by(&"#{params[:assignee_clean_by]}".to_sym) Assignee.class_eval %Q{ def assignee_name self["#{params[:assignee_clean_by]}"] end } end
def do_assignee_cleaning Assignee.find(1).assignee_name redirect_to assignee_cleaning_project_assignees_path(params[:project_id]) end end in assignees.html.erb @assignees.each do |assignee| assignee.assignee_name end I am able to call assignee_name method on assignee object in assignees.html.erb. But in do_assignee_cleaning action, i get error undefined method `assignee_name' for #<Assignee:0xc306ac> why? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.