I am having trouble rendering a partial called ‘names’ through a submit
tag located within that partial. The form data is saving with my current
code. However, the existing data is not loading into the form and the
partial is not being re-rendered upon submission to reveal the changes
to this data.What might I do to fix this?
- <%= render :partial => 'names', :object => @person
_names.rhml (lists the names of ‘Person’. Clicking on a name reveals a
form to edit that name)
<% for name in @person.current_names %>
<%= link_to_function (name.full_name, :onclick =>
@name = Name.find(params[:id])
return if request.xhr?
render :partial => ‘names’
Code : ruby - fold - unfold
page.replace_html(“name_list”, :partial => “names”, :object => @person)