I’ve been trying incorporate the in_place_editor, but have had no luck
so far. I read the Ajax.In Place editor wiki on script.aculos.us which
was informing, but still left me wondering about a few things.
Here’s what I’m trying to do. A user has a profile page which lists
their name, age, homepage, etc… There is no form on this page…
it’s just regular text. Here’s a snippet:
<p> <div class="profile_details_container"> <span class="profile_title">Email:</span> <span class="profile_info"><%= @user.email %></span> </div> </p>
When a user clicks on the text inside the
tags I would like a text box to pop up in it’s place which allows the
user to edit their value.
I got the in place editor to show up by doing the following:
At the top of my profile controller I placed the following:
in_place_edit_for :profile, :age
This is where I have a question. How do would I actually go about
saving the new value that was inputted into the text box that popped
up? I have the following in the ‘ajax_update’ action. This obviously
@profile = params[:value]
render :layout => false, :inline => “<%= @profile.age ) %>”
Am I close? Is there a better way to accomplish what I’m trying to do?