On 21 June 2011 11:45, mukesh singh <[email protected]> wrote:
> sorry for mistake not Assignee.assignee_name
> Assignee.find(1).assignee_name

Do you mean that you have fixed the problem by that change, or that
you had a mistake in the question you asked and with
Assignee.find(1).assignee_name it still fails?

Colin

>
> On Tue, Jun 21, 2011 at 4:08 PM, Colin Law <[email protected]> wrote:
>>
>> On 21 June 2011 11:11, mukesh singh <[email protected]> wrote:
>> > class AssigneesController < ApplicationController
>> >  def assignees
>> >     Assignee.class_eval %Q{
>> >                 def assignee_name
>> >                     self["#{params[:assignee_by]}"]
>> >                 end
>> >            }
>> >   end
>> >   def do_assignee_cleaning
>> >       Assignee.assignee_name
>> >       redirect_to
>> > assignee_cleaning_project_assignees_path(params[:project_id])
>> >   end
>> >
>> > end
>> > I want to use assignee_name method in do_assignee_cleaning action but i
>> > am
>> > getting  error undefined
>> > method `assignee_name' for class `Assignee' in do_assignee_cleaning
>>
>> In an effort to understand the question (not having used class_eval) I
>> found the following link that suggests, rather non-intuitively, that
>> you should be using instance_eval rather than class_eval.
>>
>>
>> http://ilikestuffblog.com/2009/01/09/fun-with-rubys-instance_eval-and-class_eval/
>>
>> Colin
>>
>> --
>> 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 [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> 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 [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to