Is it possible to load pre-existing data into a form with
form_remote_tag? I am trying to load the data for a Person object into
the partial ''name_form'' through a link in another partial
''name_list''.
However, the ''name_form'' partial renders without any data. Any
idea how
I might get this to work?
(http://pastie.caboo.se/94816)
(_name_list.rhml)
<% for personname in @person.current_names %>
<%= link_to_function ''personname.name'', :action =>
''update_name'', :id =>
@person_name, :onclick =>
"Element.show(''update_name'')"%>
<% end %>
(person/show.rhtml)
<%= render :partial => ''name_list'', :object =>
@person %>
<div id="update_name" style="display:none;">
<% form_remote_tag (:url => {:action =>
''update_name'', :id =>
@person_name}) do %>
<%= render :partial => ''name_form'' %>
<%= submit_tag ''Update'' %>
<% end %>
</div>
(persons_controller.rb)
class PeopleController < ApplicationController
def update_name
id = params[:id]
@person_name = ClaimantName.find(params[:id])
end
end
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---