In_place_editor and no access to value

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

Brian N. 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 J. wrote:

Brian N. 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!

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 N. wrote:

Mark Reginald J. wrote:

Brian N. 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!