Thursday, July 31st, 2008...1:21 pm

Rails 2.x In Place Editor

Jump to Comments

I had the need to use the old in_place_editor functionality in a new Rails app that I’m working on. I hadn’t used the functionality for a while now and using it in a Rails 2.x environment is a bit different than in a Rails 1.x environment so I thought I’d share what I found.

The in_place_editor functionality has been completed deprecated in the Rails 2.x codebase and now you need to install the plugin to use the functionality. To install the plugin use the following command from your rails root directory:

ruby script/plugin install http://svn.rubyonrails.org/rails/plugins/in_place_editing

Now, if you are using the new authenticity token features of Rails 2, the plugin won’t work for you out of the box. First you will need to apply this patch. It’s best to apply the patch even if you aren’t using the authenticity token feature just so you are “future-proof.” I’m not sure why the plugin trunk hasn’t been updated with the patch already, but it hasn’t so you need to do it yourself.

Now you can use both the in_place_editor and in_place_editor_field helpers in your view files.

Leave a Reply