rss
twitter
    Find out what I'm doing, Follow Me :)

Ajax Editing using In-Place Form Editing

Your application has data that are often edited by
your users—usually very quickly. You want to give your users an easy
way to edit application data in place without having to open a separate
editing form.

Rails makes in-place editing easy with the script.aculo.us InPlaceEditor
control and accompanying helpers.

First create a model and controller.

Put JavaScript files in your views. Somewhere in the head
of your HTML document, you can call the following:

<%=javascript_include_tag :defaults%>

put the in place editor in you .rhtml file like this


<%=in_place_editor_field :contact, :name%>


In Controller write the following line
in_place_edit_for :contact, :name

and its done.

0 comments: