New in_place_editor plugin

July 23rd, 2007

I have just released a new plugin that can be found at http://agilewebdevelopment.com/plugins/improved_in_place_editor

This plugin allows all options of the Ajax.InPlaceEditor control to be set. This will also work with the new rewrite of the control, which is currently in the scriptaculous trunk.

This plugin replaces the current rails version of in_place_editor and is drop-in compatible.

Quick summary (more details at the url above)...

Missing options such as onFailure can now be specified…

<%= in_place_editor 'field_id', :on_failure => "function(transport) {alert(\"Error: \" + transport.responseText.stripTags());}" %>

Some options require quoting to be valid in the JS, such as :highlight_color.[1]

1 :highlight_color is the option name for the rewritten version of the control, :highlightcolor is the old name.

The 2 ways to specify the option are…

1) Manually quote the option
<%= in_place_editor 'field_id', :highlight_color => "’#000000’" %>
2) Use the :quoted option
<%= in_place_editor 'field_id', :quoted => {:highlight_color => ’#000000’} %>

Check out our other available plugins at http://agilewebdevelopment.com/plugins/owner/72

4 Responses Follows

  1. angus says

    hi, this plugin seems not to work in edge. Any fixes arround that you know of?

  2. Andrew says

    Hey Angus, the in_place_editor code in edge has been made into a plugin (http://dev.rubyonrails.org/ticket/9513), so that would have to be installed to start (which you might have done already).

    Even if the rails plugin is installed along with my plugin, it still may not work due to mine being dependent on the rails plugin and the order they’re loaded possibly being incorrect. I could fix this with some hooks so that it works with edge, but as of right now there is no simple workaround.

    I’ll try to get a fix out soon. Thanks for reporting the problem.

  3. Andrew says

    Actually, you could try using the config.plugins option in your environment file to specify the load order, or just install both plugins and see if things work… the default load order is alphabetical.

  4. Andrew says

    Install http://svn.rubyonrails.org/rails/plugins/in_place_editing/ and the default alphabetical ordering should work for now. I hope to have a proper fix at some point in the future though.


Your Response