Redline Software Inc. - Winnipeg's Leader in Ruby on Rails Development

New In_place_editor Plugin

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…

1
<%= 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

1
<%= in_place_editor 'field_id', :highlight_color => "’#000000’" %>

2) Use the :quoted option

1
<%= in_place_editor 'field_id', :quoted => {:highlight_color => #000000’} %>

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

Comments