# how to use in\_place\_editor\_field

**URL:** <https://discuss.rubyonrails.org/t/how-to-use-in-place-editor-field/63262>\
**Category:** rubyonrails-talk\
**Created:** [March 16, 2012, 6:46am UTC](https://discuss.rubyonrails.org/t/how-to-use-in-place-editor-field/63262 "2012-03-16T06:46:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![hanish\_jadala](https://avatars.discourse-cdn.com/v4/letter/h/eada6e/32.png) [@hanish\_jadala](https://discuss.rubyonrails.org/u/hanish_jadala)\
**Post date:** [March 16, 2012, 6:46am UTC](https://discuss.rubyonrails.org/t/how-to-use-in-place-editor-field/63262/1 "2012-03-16T06:46:01Z")

</div>

hi everyone i wanna use in\_place\_editor\_field i've installed the Plug- in and when i'm trying to use it. \<%= in\_place\_editor\_field :subject, :credit\_hour %\> i have added this line in view part and in\_place\_edit\_for :subject, :credit\_hour line in controller. Here :subject is model name and :credit\_hour is column in subject model. i have values 0 so i am unable to view that value to update it.

is there anything more i have to do please help me

Thanks in advance

---

<div class="post-metadata">

**Author:** ![hanish\_jadala](https://avatars.discourse-cdn.com/v4/letter/h/eada6e/32.png) [@hanish\_jadala](https://discuss.rubyonrails.org/u/hanish_jadala)\
**Post date:** [March 16, 2012, 7:18am UTC](https://discuss.rubyonrails.org/t/how-to-use-in-place-editor-field/63262/2 "2012-03-16T07:18:44Z")

</div>

while i am using in\_place\_editor\_field i am getting this error

```ruby
Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id

```

---

<div class="post-metadata">

**Author:** ![Colin\_Law1](https://avatars.discourse-cdn.com/v4/letter/c/91b2a8/32.png) [@Colin\_Law1](https://discuss.rubyonrails.org/u/Colin_Law1)\
**Post date:** [March 16, 2012, 8:37am UTC](https://discuss.rubyonrails.org/t/how-to-use-in-place-editor-field/63262/3 "2012-03-16T08:37:40Z")

</div>

> while i am using in\_place\_editor\_field i am getting this error
> 
> Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object\_id

Read the error and have a look at the line pointed to. Something there is nil. Look in development.log and check that the parameters passed are correct. Have a look at the Rails Guide on debugging to see how to debug your code to find the problem.

Colin

---

<div class="post-metadata">

**Author:** ![bluetwin](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@bluetwin](https://discuss.rubyonrails.org/u/bluetwin)\
**Post date:** [March 16, 2012, 5:50pm UTC](https://discuss.rubyonrails.org/t/how-to-use-in-place-editor-field/63262/4 "2012-03-16T17:50:32Z")

</div>

You look to have an object issue with ":subject" \<%= in\_place\_editor\_field :subject, :credit\_hour %\>

Have you tried this in your controller @subject = Subject.new then in your view \<%= in\_place\_editor\_field @subject, :credit\_hour %\>

Also this is deprecated in Rails 2.0: [http://apidock.com/rails/ActionView/Helpers/JavaScriptMacrosHelper/in\_place\_editor\_field](http://apidock.com/rails/ActionView/Helpers/JavaScriptMacrosHelper/in_place_editor_field) DEPRECATION WARNING: This method will become a separate plugin when Rails 2.0 ships.

I suggest the best\_in\_place plugin in place of in\_place\_editor. [https://github.com/bernat/best\_in\_place](https://github.com/bernat/best_in_place)

---

<div class="post-metadata">

**Author:** ![hanish\_jadala](https://avatars.discourse-cdn.com/v4/letter/h/eada6e/32.png) [@hanish\_jadala](https://discuss.rubyonrails.org/u/hanish_jadala)\
**Post date:** [March 17, 2012, 5:53am UTC](https://discuss.rubyonrails.org/t/how-to-use-in-place-editor-field/63262/5 "2012-03-17T05:53:25Z")

</div>

yeah i tried it i got it but the value is not saving it is redirecting my home page.

---

<div class="post-metadata">

**Author:** ![hanish\_jadala](https://avatars.discourse-cdn.com/v4/letter/h/eada6e/32.png) [@hanish\_jadala](https://discuss.rubyonrails.org/u/hanish_jadala)\
**Post date:** [March 17, 2012, 6:33am UTC](https://discuss.rubyonrails.org/t/how-to-use-in-place-editor-field/63262/6 "2012-03-17T06:33:58Z")

</div>

does best\_in\_place will work in rails 2.3.8

---

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [January 8, 2015, 11:44am UTC](https://discuss.rubyonrails.org/t/how-to-use-in-place-editor-field/63262/7 "2015-01-08T11:44:13Z")

</div>

I solved the issue,

now I am working on a maintenance project which is in rails 2.3.8. And this issue ate a lot of my time

In the view

Change the view to have an instance variable

\<% @batch = batch %\> \<%= in\_place\_editor\_field :batch, 'priority' %\>
