Forum: Ruby on Rails in_place_editor and no access to value

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E458de7b2e71b722b7204d001e222b68?d=identicon&s=25 Brian Nice (Guest)
on 2006-05-20 05:20
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
C64e63b70be7dfed8b0742540b8b27e5?d=identicon&s=25 Mark Reginald James (Guest)
on 2006-05-20 13:27
(Received via mailing list)
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.
E458de7b2e71b722b7204d001e222b68?d=identicon&s=25 Brian Nice (Guest)
on 2006-05-20 21:18
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!
1c46e952a61c99d9eae4f21037a088fd?d=identicon&s=25 Anatol Pomozov (Guest)
on 2006-05-21 05:31
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!
This topic is locked and can not be replied to.