Ok I am on rails 2.1 My show view does not have a"for_for" but the controller has @nocpage = Nocpage.find(params[:id]) and the view for section i am trying to use: <b>Companyname:</b> <%=h @nocpage.companyname %> I tried doing: <% @name = @nocpage.companyname %> <%= in_place_editor_field ''name'', :companyname %> but I keep getting: undefined method `companyname'' for "att":String. Why does it keep saying undefined method? --~--~---------~--~----~------------~-------~--~----~ 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 7 Sep 2008, at 16:30, Me wrote:> > Ok I am on rails 2.1 > > My show view does not have a"for_for" but the controller has > @nocpage = Nocpage.find(params[:id]) > > and the view for section i am trying to use: > > <b>Companyname:</b> > <%=h @nocpage.companyname %> > > I tried doing: > <% @name = @nocpage.companyname %> > <%= in_place_editor_field ''name'', :companyname %> >I suspect you mean in_place_editor_field ''nocpage'', ''companyname'' the first parameter should be the name of an instance variable, the second the name of a method on that object (the one that corresponds to the property to edit) Fred> but I keep getting: > > undefined method `companyname'' for "att":String. Why does it keep > saying undefined method? > > >--~--~---------~--~----~------------~-------~--~----~ 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. The show page works but I am not getting an edit box to pop up. I see this with a view source: <b>Companyname:</b> <span class="in_place_editor_field" id="nocpage_companyname_1_in_place_editor">att</span><script type="text/javascript"> //<![CDATA[ new Ajax.InPlaceEditor(''nocpage_companyname_1_in_place_editor'', ''/ nocpages/set_nocpage_companyname/1'') //]]> </script> On Sep 7, 12:23 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 7 Sep 2008, at 16:30, Me wrote: > > > > > Ok I am on rails 2.1 > > > My show view does not have a"for_for" but the controller has > > @nocpage = Nocpage.find(params[:id]) > > > and the view for section i am trying to use: > > > <b>Companyname:</b> > > <%=h @nocpage.companyname %> > > > I tried doing: > > <% @name = @nocpage.companyname %> > > <%= in_place_editor_field ''name'', :companyname %> > > I suspect you mean > > in_place_editor_field ''nocpage'', ''companyname'' > > the first parameter should be the name of an instance variable, the > second the name of a method on that object (the one that corresponds > to the property to edit) > > Fred > > > but I keep getting: > > > undefined method `companyname'' for "att":String. Why does it keep > > saying undefined method?--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
DOH. Never mind. Forgot the javsacript include tag. I started this last night on a different computer. On Sep 7, 12:35 pm, Me <chabg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Thanks. The show page works but I am not getting an edit box to pop > up. I see this with a view source: > > <b>Companyname:</b> > > <span class="in_place_editor_field" > id="nocpage_companyname_1_in_place_editor">att</span><script > type="text/javascript"> > //<![CDATA[ > new Ajax.InPlaceEditor(''nocpage_companyname_1_in_place_editor'', ''/ > nocpages/set_nocpage_companyname/1'') > //]]> > </script> > > On Sep 7, 12:23 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > On 7 Sep 2008, at 16:30, Me wrote: > > > > Ok I am on rails 2.1 > > > > My show view does not have a"for_for" but the controller has > > > @nocpage = Nocpage.find(params[:id]) > > > > and the view for section i am trying to use: > > > > <b>Companyname:</b> > > > <%=h @nocpage.companyname %> > > > > I tried doing: > > > <% @name = @nocpage.companyname %> > > > <%= in_place_editor_field ''name'', :companyname %> > > > I suspect you mean > > > in_place_editor_field ''nocpage'', ''companyname'' > > > the first parameter should be the name of an instance variable, the > > second the name of a method on that object (the one that corresponds > > to the property to edit) > > > Fred > > > > but I keep getting: > > > > undefined method `companyname'' for "att":String. Why does it keep > > > saying undefined method?--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---