ajax in place editing with rails 2.1 and jquery

Picture 1.png

Install jrails and jrails_in_place_editing

script/plugin install git://github.com/aaronchi/jrails.git
script/plugin install git://github.com/rakuto/jrails_in_place_editing.git

Setup jrails in application.html.erb

1
2
3
<head>
	<%= javascript_include_tag :defaults %>
</head>

Restart your server

Setup jrails_in_place_editing in the..

1. ..Controller

1
2
3
4
class ProjectsController < ApplicationController
  in_place_edit_for :project, :acreage
  ...
end

2. ..View

1
  <%= in_place_editor_field :project, :acreage %>

That’s it. For more on customization and additional options check out the jrails_in_place_editing readme at:

Comments