How to use in_place_editor_field

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

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

On 16 March 2012 07:18, hanish jadala [email protected]
wrote:

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

in subject model. i have values 0 so i am unable to view that value to
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.


gplus.to/clanlaw

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
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.

does best_in_place will work in rails 2.3.8

On Sat, Mar 17, 2012 at 11:23 AM, hanish jadala

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

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’ %>