ok, I am really pulling my hair out here over something that should be simple. (Rails2, In_place_editor plugin) In my index.html.erb, I have: <ul> <% @tasks.each do |root| %> <li><%= render(:partial => "task_node", :object => root) %></li> <% end %> </ul> In my _task_node.html.erb, I have: <%= in_place_editor_field task_node, ''description'' %> <ul><% task_node.children.each do |child| %> <li><%= render(:partial => "task_node", :object => root) %></li> <% end %></ul> I get an error which is "Called id for nil, which would mistakenly be 4........" (error comes from line 73 of in_place_macros_helper) I am using this in the "normal" way successfully elsewhere in my project. Thanks in advance before I go bald, Alan --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Thu, Mar 27, 2008 at 11:42 AM, Alan Smith <alan0412-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I get an error which is > "Called id for nil, which would mistakenly be 4........"<ul><% task_node.children.each do |child| %>> <li><%= render(:partial => "task_node", :object => root) %></li> ><% end %></ul>Shouldn''t that be :object => child ? Mikel http://lindsaar.net/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Mikel, It is in the code. I got lazy with cut and paste trying to give a simpler example. Good catch, though! --Alan On Wed, Mar 26, 2008 at 10:27 PM, Mikel Lindsaar <raasdnil-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > On Thu, Mar 27, 2008 at 11:42 AM, Alan Smith <alan0412-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I get an error which is > > "Called id for nil, which would mistakenly be 4........" > > <ul><% task_node.children.each do |child| %> > > <li><%= render(:partial => "task_node", :object => root) %></li> > ><% end %></ul> > > Shouldn''t that be :object => child ? > > Mikel > http://lindsaar.net/ > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 27 Mar 2008, at 00:42, Alan Smith wrote:> > ok, I am really pulling my hair out here over something that should > be simple. > > (Rails2, In_place_editor plugin) > > In my index.html.erb, I have: > <ul> > <% @tasks.each do |root| %> > <li><%= render(:partial => "task_node", :object => root) %></li> > <% end %> > </ul> > > In my _task_node.html.erb, I have: > <%= in_place_editor_field task_node, ''description'' %>in_place_editor_field is one of the old school helper so it''s expecting the first parameter to be the name of an instance variable. A quick and dirty fix would be to put <% @task_node = task_node %> on the line above and change it to <%= in_place_editor_field ''task_node'', ''description'' %> Fred --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Well, this gets me part of the way there. (although I have to admit, I don''t understand why.) However, the HTML generated is: <span class="in_place_editor_field" id="#<Task:0x2b2d504701f0>_description_4_in_place_editor"></span><script type="text/javascript"> //<![CDATA[ new Ajax.InPlaceEditor(''#<Task:0x2b2d504701f0>_description_4_in_place_editor'', ''/tasks/set_%23%3CTask:0x2b2d504701f0%3E_description/4'', {callback:function(form) { return Form.serialize(form) + ''&authenticity_token='' + encodeURIComponent(''de08c07c32d0105cd81841fc23d2b1ef4d4ea89f'') }}) //]]> </script> Why doesn''t it put the current value of the description in between the span tags? (since there is no place to click, it isn''t very helpful....) Thanks in advance, Alan On Thu, Mar 27, 2008 at 9:21 AM, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On 27 Mar 2008, at 00:42, Alan Smith wrote: > > > > > ok, I am really pulling my hair out here over something that should > > be simple. > > > > (Rails2, In_place_editor plugin) > > > > In my index.html.erb, I have: > > <ul> > > <% @tasks.each do |root| %> > > <li><%= render(:partial => "task_node", :object => root) %></li> > > <% end %> > > </ul> > > > > In my _task_node.html.erb, I have: > > <%= in_place_editor_field task_node, ''description'' %> > > in_place_editor_field is one of the old school helper so it''s > expecting the first parameter to be the name of an instance variable. > A quick and dirty fix would be to put <% @task_node = task_node %> on > the line above and change it to > > <%= in_place_editor_field ''task_node'', ''description'' %> > > Fred > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 27 Mar 2008, at 14:49, Alan Smith wrote:> > Well, this gets me part of the way there. (although I have to admit, > I don''t understand why.) >it looks like you;ve still got <%= in_place_editor_field task_node, ''description'' %> in your form instead of <%= in_place_editor_field ''task_node'', ''description'' %>> > However, the HTML generated is: > <span class="in_place_editor_field" > id="#<Task:0x2b2d504701f0>_description_4_in_place_editor"></ > span><script > type="text/javascript"> > //<![CDATA[ > new Ajax.InPlaceEditor(''#<Task: > 0x2b2d504701f0>_description_4_in_place_editor'', > ''/tasks/set_%23%3CTask:0x2b2d504701f0%3E_description/4'', > {callback:function(form) { return Form.serialize(form) + > ''&authenticity_token='' + > encodeURIComponent(''de08c07c32d0105cd81841fc23d2b1ef4d4ea89f'') }}) > //]]> > </script> > > Why doesn''t it put the current value of the description in between the > span tags? (since there is no place to click, it isn''t very > helpful....) > > Thanks in advance, > > Alan > > > On Thu, Mar 27, 2008 at 9:21 AM, Frederick Cheung > <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> >> On 27 Mar 2008, at 00:42, Alan Smith wrote: >> >>> >>> ok, I am really pulling my hair out here over something that should >>> be simple. >>> >>> (Rails2, In_place_editor plugin) >>> >>> In my index.html.erb, I have: >>> <ul> >>> <% @tasks.each do |root| %> >>> <li><%= render(:partial => "task_node", :object => root) %></li> >>> <% end %> >>> </ul> >>> >>> In my _task_node.html.erb, I have: >>> <%= in_place_editor_field task_node, ''description'' %> >> >> in_place_editor_field is one of the old school helper so it''s >> expecting the first parameter to be the name of an instance variable. >> A quick and dirty fix would be to put <% @task_node = task_node %> on >> the line above and change it to >> >> <%= in_place_editor_field ''task_node'', ''description'' %> >> >> Fred >> >> >> >>> >> > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thanks, that did it! --Alan On Thu, Mar 27, 2008 at 10:15 AM, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On 27 Mar 2008, at 14:49, Alan Smith wrote: > > > > > Well, this gets me part of the way there. (although I have to admit, > > I don''t understand why.) > > > it looks like you;ve still got <%= in_place_editor_field task_node, > ''description'' %> in your form instead of <%= in_place_editor_field > > > ''task_node'', ''description'' %> > > > > However, the HTML generated is: > > <span class="in_place_editor_field" > > id="#<Task:0x2b2d504701f0>_description_4_in_place_editor"></ > > span><script > > type="text/javascript"> > > //<![CDATA[ > > new Ajax.InPlaceEditor(''#<Task: > > 0x2b2d504701f0>_description_4_in_place_editor'', > > ''/tasks/set_%23%3CTask:0x2b2d504701f0%3E_description/4'', > > {callback:function(form) { return Form.serialize(form) + > > ''&authenticity_token='' + > > encodeURIComponent(''de08c07c32d0105cd81841fc23d2b1ef4d4ea89f'') }}) > > //]]> > > </script> > > > > Why doesn''t it put the current value of the description in between the > > span tags? (since there is no place to click, it isn''t very > > helpful....) > > > > Thanks in advance, > > > > Alan > > > > > > On Thu, Mar 27, 2008 at 9:21 AM, Frederick Cheung > > <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> > >> > >> On 27 Mar 2008, at 00:42, Alan Smith wrote: > >> > >>> > >>> ok, I am really pulling my hair out here over something that should > >>> be simple. > >>> > >>> (Rails2, In_place_editor plugin) > >>> > >>> In my index.html.erb, I have: > >>> <ul> > >>> <% @tasks.each do |root| %> > >>> <li><%= render(:partial => "task_node", :object => root) %></li> > >>> <% end %> > >>> </ul> > >>> > >>> In my _task_node.html.erb, I have: > >>> <%= in_place_editor_field task_node, ''description'' %> > >> > >> in_place_editor_field is one of the old school helper so it''s > >> expecting the first parameter to be the name of an instance variable. > >> A quick and dirty fix would be to put <% @task_node = task_node %> on > >> the line above and change it to > >> > >> <%= in_place_editor_field ''task_node'', ''description'' %> > >> > >> Fred > >> > >> > >> > >>> > >> > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---