Hi All, I''m trying to use the in_place_editor with a list and ended up having to do this: <% for task in @tasks %> <li> <% @task = task %> <%= in_place_editor_field :task, :name %> ... Is there a way not to have to assign an instance variable for each task in @tasks just to use it with the in_place_editor_field? Thanks, Abdullah --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Abdullah Jibaly wrote:> I''m trying to use the in_place_editor with a list and ended up having to > do this: > > <% for task in @tasks %> > <li> > <% @task = task %> > <%= in_place_editor_field :task, :name %> > ... > > Is there a way not to have to assign an instance variable for each task > in @tasks just to use it with the in_place_editor_field?for @task in @tasks -- We develop, watch us RoR, in numbers too big to ignore. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Hi Mark, That gives me this error: NameError in Tasks#index Showing *app/views/tasks/list.rhtml* where line *#9* raised: undefined local variable or method `task'' for #<#<Class:0xb7844628>:0xb7844600> Thanks, Abdullah On 9/19/06, Mark Reginald James <mrj-bzGI/hKkdgQnC9Muvcwxkw@public.gmane.org> wrote:> > > Abdullah Jibaly wrote: > > > I''m trying to use the in_place_editor with a list and ended up having to > > do this: > > > > <% for task in @tasks %> > > <li> > > <% @task = task %> > > <%= in_place_editor_field :task, :name %> > > ... > > > > Is there a way not to have to assign an instance variable for each task > > in @tasks just to use it with the in_place_editor_field? > > for @task in @tasks > > > -- > We develop, watch us RoR, in numbers too big to ignore. > > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Abdullah Jibaly wrote:> That gives me this error: > > NameError in Tasks#index > > Showing /app/views/tasks/list.rhtml/ where line *#9* raised: > > |undefined local variable or method `task'' for #<#<Class:0xb7844628>:0xb7844600>|Abdullah, did you delete the <% @task = task %> line, and just have: <% for @task in @tasks %> <li> <%= in_place_editor_field :task, :name %> <% end %> ? -- We develop, watch us RoR, in numbers too big to ignore. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Yeah, I did... I wonder why you can''t assign instance variables like that it the for loop. On 9/19/06, Mark Reginald James <mrj-bzGI/hKkdgQnC9Muvcwxkw@public.gmane.org> wrote:> > > Abdullah Jibaly wrote: > > > That gives me this error: > > > > NameError in Tasks#index > > > > Showing /app/views/tasks/list.rhtml/ where line *#9* raised: > > > > |undefined local variable or method `task'' for > #<#<Class:0xb7844628>:0xb7844600>| > > Abdullah, did you delete the <% @task = task %> line, and just have: > > <% for @task in @tasks %> > <li> > <%= in_place_editor_field :task, :name %> > <% end %> > > ? > > -- > We develop, watch us RoR, in numbers too big to ignore. > > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Abdullah Jibaly wrote:> Yeah, I did... I wonder why you can''t assign instance variables like > that it > the for loop.This should work: <% for @task in @tasks %> <li> <%= in_place_editor_field "task", "name" %> <% end %> -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---