Thanks for your reply I thought class_eval method would permanently add assignee_name method to Assignee instance object and i can access from other action too.
On Tue, Jun 21, 2011 at 5:20 PM, Chirag Singhal <chirag.sing...@gmail.com>wrote: > Curious why you would want to define the method that way, are you > overriding the method assignee_name which is already defined in the Assignee > class? > If not, then why not define it directly in the model like this: > > def assignee_name(assigned_by) > self["assigned_by"**] > end > > Controller method will be > def do_assignee_cleaning > Assignee.assignee_name(params[:assignee_by]) > redirect_to assignee_cleaning_project_**assignees_path(params[:** > project_id]) > end > > -- > > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-talk/-/aVbAUtgf5QQJ. > > 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. > -- Regards Mukesh Paras Singh -- 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.