# In\_place\_editor and no access to value

**URL:** <https://www.ruby-forum.com/t/in-place-editor-and-no-access-to-value/61105>\
**Category:** Rails\
**Created:** [May 20, 2006, 5:20am UTC](https://www.ruby-forum.com/t/in-place-editor-and-no-access-to-value/61105 "2006-05-20T05:20:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bcnice99](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ecc23a/32.png) [@bcnice99](https://www.ruby-forum.com/u/bcnice99)\
**Post date:** [May 20, 2006, 5:20am UTC](https://www.ruby-forum.com/t/in-place-editor-and-no-access-to-value/61105/1 "2006-05-20T05:20:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bcnice99](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ecc23a/32.png) [@bcnice99](https://www.ruby-forum.com/u/bcnice99)\
**Post date:** [May 20, 2006, 1:27pm UTC](https://www.ruby-forum.com/t/in-place-editor-and-no-access-to-value/61105/2 "2006-05-20T13:27:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bcnice99](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ecc23a/32.png) [@bcnice99](https://www.ruby-forum.com/u/bcnice99)\
**Post date:** [May 20, 2006, 9:18pm UTC](https://www.ruby-forum.com/t/in-place-editor-and-no-access-to-value/61105/3 "2006-05-20T21:18:56Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![bcnice99](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ecc23a/32.png) [@bcnice99](https://www.ruby-forum.com/u/bcnice99)\
**Post date:** [May 21, 2006, 5:31am UTC](https://www.ruby-forum.com/t/in-place-editor-and-no-access-to-value/61105/4 "2006-05-21T05:31:08Z")

</div>

For some reason some time ago Scriptaculous developers remove ‘value’  
parameter from callbacks. See [http://dev.rubyonrails.org/ticket/3529](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!
