Plugins - Improved in_place_editor

StarAdd to favorites

InPlaceEditor

=======

v0.9

An improved in_place_editor method than that provided in rails.

This plugin is drop-in compatible with the current/old in_place_editor method, but adds the ability to specify any option that the Ajax.InPlaceEditor control accepts.

The current rails version is missing a lot of valid options for the control, but this plugin will accept any current and new parameters for the control.

For example, the current rails version (< 2.0) doesn’t allow the setting of onFailure for the control, but with this plugin, simply specify it as follows… :on_failure => "function(transport) {alert(\"Error: \" + transport.responseText.stripTags());}"

The option translation simply converts underscored options to camelcase in the JS. eg. :on_failure -> onFailure, :rows -> rows, :highlight_color -> highlightColor

  • note

highlightColor is the name of the option in the new rewritten version of the control, highlightcolor (no capital C) is used in the version 1.7 of scriptaculous and previous versions.

Some options require quoting to be valid in the JS, such as :highlight_color. The 2 ways to specify the option are…

1) Manually quote the option :highlight_color => "’#000000’"

2) Use the :quoted option :quoted => {:highlight_color => ’#000000’}

Redline Software Inc.

http://www.redlinesoftware.com

http://svn.redlinesoftware.com/plugins/in_place_editor

Rails' (MIT)

  • Currently 4.2/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

View Extensions

Tags

Comments

Add a comment
Tonypm 7 Apr 2008

Seems like there is an rb file missing? ie. inplaceedit_for results in undefined method error

warning! this plugin does not escape html 1 Apr 2008

fix it with h(displaytext) on line 234 superinplace_controls.rb

Andrew 18 Sep 2007

I jumped the gun a bit earlier. I don't currently have a dependency fix for edge, but if you install the inplaceeditor plugin from edge (http://svn.rubyonrails.org/rails/plugins/inplaceediting/) and install this plugin as well, the default alphabetical order for loading plugins should be fine for now. This plugin will load after the rails one has been loaded in order to override it's current behaviour. Otherwise use the config.plugins option in your environment file to force the order.

Andrew 17 Sep 2007

Should now work in edge.

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?