I have the following in my rhtml and I get an error that ''value'' does not exist. This looks like the examples that I have seen so I am not sure what I am doing wrong. If I take off the :with part, I get a value parameter passed to my controller, but then I can''t figure out how to get the country id passed like I need to. <%= in_place_editor ''add_country_area'', :url => {:action => ''add_country_area''}, :with => "''value=''+escape(value)+''country=''+document.add_trip.country.selectedIndex" %> Thanks for the help Brian -- Posted via http://www.ruby-forum.com/.
Mark Reginald James
2006-May-20 11:25 UTC
[Rails] Re: in_place_editor and no access to value
Brian Nice wrote:> I have the following in my rhtml and I get an error that ''value'' does > not exist. This looks like the examples that I have seen so I am not > sure what I am doing wrong. If I take off the :with part, I get a value > parameter passed to my controller, but then I can''t figure out how to > get the country id passed like I need to. > > <%= in_place_editor ''add_country_area'', > :url => {:action => ''add_country_area''}, > :with => > "''value=''+escape(value)+''country=''+document.add_trip.country.selectedIndex"Try :with => "Form.serialize(form) + ''&country='' + document.add_trip.country.selectedIndex" -- We develop, watch us RoR, in numbers too big to ignore.
Mark Reginald James wrote:> Brian Nice wrote: >> I have the following in my rhtml and I get an error that ''value'' does >> not exist. This looks like the examples that I have seen so I am not >> sure what I am doing wrong. If I take off the :with part, I get a value >> parameter passed to my controller, but then I can''t figure out how to >> get the country id passed like I need to. >> >> <%= in_place_editor ''add_country_area'', >> :url => {:action => ''add_country_area''}, >> :with => >> "''value=''+escape(value)+''country=''+document.add_trip.country.selectedIndex" > > Try :with => > "Form.serialize(form) + ''&country='' + > document.add_trip.country.selectedIndex" > > -- > We develop, watch us RoR, in numbers too big to ignore.That worked! Any reason why the way I was doing it didn''t work? Thanks a lot! -- Posted via http://www.ruby-forum.com/.
For some reason some time ago Scriptaculous developers remove ''value'' parameter from callbacks. See http://dev.rubyonrails.org/ticket/3529 I believe that it is a ''feature'' not a bug. Brian Nice wrote:> Mark Reginald James wrote: >> Brian Nice wrote: >>> I have the following in my rhtml and I get an error that ''value'' does >>> not exist. This looks like the examples that I have seen so I am not >>> sure what I am doing wrong. If I take off the :with part, I get a value >>> parameter passed to my controller, but then I can''t figure out how to >>> get the country id passed like I need to. >>> >>> <%= in_place_editor ''add_country_area'', >>> :url => {:action => ''add_country_area''}, >>> :with => >>> "''value=''+escape(value)+''country=''+document.add_trip.country.selectedIndex" >> >> Try :with => >> "Form.serialize(form) + ''&country='' + >> document.add_trip.country.selectedIndex" >> >> -- >> We develop, watch us RoR, in numbers too big to ignore. > > That worked! Any reason why the way I was doing it didn''t work? > Thanks a lot!-- Posted via http://www.ruby-forum.com/.