Hello ! I'm trying to use jeditable with my rails 3 apps. I would like to edit some fields inline. Actually it's working on my client side but the data isn't updated in my app.
Could you take a look? Thanks in advance!
my view:
<dt>Overview :</dt>
<dd class="edit_textfield" id="<%= @project.id %>" name="overview"><%= @project.overview %></dd>
my controller:
def update
project = Project.find(params[:id])
overview = params[:value]
project.save
render :text => params[:value]
end
my application.js:
$(".edit_textfield").each( function() {
$(this).editable('update', {
type : 'textarea',
cancel : 'Cancel',
submit : 'OK',
indicator : 'Saving...',
tooltip : 'Click to edit...',
rows : 10,
method : "put",
submitdata : {id: $(this).attr('id'), name:$(this).attr('name') }
});
});