I''m doing some incremental improvements on scaffolding, and want to add
in-place editing to an admin section. I think I may have the view part
working right (at least, the editor pops up as expected) with this in my
view:
###
<% for link in @links %>
<tr>
<td> <div id="<%= ''url'' + link.id.to_s
-%>"><%= link.url %></div></td>
<%= in_place_editor (''url'' + link.id.to_s, :url =>
{:action =>
''edit_inplace''} ) %>
<td> <div id="<%= ''title_'' +
link.id.to_s -%>"><%= link.title
%></div></td>
<%= in_place_editor (''title_'' + link.id.to_s) %>
<td> <div id="<%= ''user_'' + link.id.to_s
-%>"><%= link.user
%></div></td>
<%= in_place_editor (''user_'' + link.id.to_s) %>
<td> <div id="<%= ''date_'' + link.id.to_s
-%>"><%= link.date
%></div></td>
<%= in_place_editor (''date_'' + link.id.to_s) %>
<td> <div id="<%= ''updated_'' +
link.id.to_s -%>"><%= link.updated
%></div></td>
<%= in_place_editor (''updated_'' + link.id.to_s) %>
<td><%= link_to ''Destroy'', { :action =>
''destroy'', :id => link },
:confirm => ''Are you sure?'' %></td>
</tr>
<% end %>
###
However, after reading the docs on the in_place_editor and
in_place_edit_for controller macro, I''m pretty stumped as to what I
need
to put into my controller to actually get the editing going. Should it be
the in_place_edit_for? Should I be using in_place_editor_field instead of
in_place_editor?
Does anyone have a working example I could use, or have any advice to
offer?
--Wade