public
Description: Restful inplace plugin for Rails
Homepage:
Clone URL: git://github.com/simplificator/inplace.git
marcoribi (author)
Thu Oct 01 05:26:18 -0700 2009
commit  9dc12fc39de573ce87f75b56b36e842f1a5869c4
tree    335b1915f0bad2996bcb50021d961d96ac341cd0
parent  6a5076f1830f3e302ca7d1a25d4e68efd3ac5aca
name age message
file MIT-LICENSE Mon Aug 11 00:04:18 -0700 2008 initialize [marcoribi]
file README Mon Aug 11 05:55:18 -0700 2008 improve readme [marcoribi]
file README~ Mon Aug 11 05:55:18 -0700 2008 improve readme [marcoribi]
file Rakefile Mon Aug 11 00:04:18 -0700 2008 initialize [marcoribi]
file init.rb Tue Sep 29 05:42:01 -0700 2009 initial commit [marcoribi]
file install.rb Tue Sep 29 05:42:01 -0700 2009 initial commit [marcoribi]
directory lib/ Thu Oct 01 05:26:18 -0700 2009 remove crazy files [marcoribi]
directory tasks/ Thu Oct 01 05:26:18 -0700 2009 remove crazy files [marcoribi]
directory test/ Mon Aug 11 00:04:18 -0700 2008 initialize [marcoribi]
file uninstall.rb Mon Aug 11 00:04:18 -0700 2008 initialize [marcoribi]
README
Inplace
=======

= What is it
Inplace is a simple RESTful in place editor based and tested on Rails 2.1.0.

= Installation
script plugin/install ...

= Usage
In your View:
<%= editable_content_tag(:span, @artist, 'name', true, nil, {:style => 'border: 1px solid grey;'}, {:okText => 'save 
it'}) %>

In your Controller:

if @artist.update_attributes(params[:artist])
    format.html { redirect_to(@artist) }
    format.json { render :json => @artist }
else
    format.html { render :action => "edit" }
    format.json { render :json => @artist, :status => SOMETHINGELSE_THAN_200}
end

Based on work by Rick: http://www.bizmeetsdev.com/articles/2008/02/09/editable_content_tag
Thanks a lot!

Copyright (c) 2008 [Simplificator GmbH -  www.simplificator.com], released under the MIT license