Forum: Ruby on Rails Default value in a Partial that use index

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Alain (Guest)
on 2006-04-12 03:33
Hi,

here is my situation. I have this controler action:

---------CONTROLER--------
  def list
    @variations = Variation.find(:all,
                                 :conditions =>["client_id = ?",
@active_client.id]
                                  )
  end
---------CONTROLER--------

Which call this view (removed irrelevant parts):

----------LIST.RHTML--------------
<p>listes des conceptes existants pour le client actif:<p/>
<%= start_form_tag (:action =>"save_list")%>
	<%= render(:partial => "variation",
			   :collection => @variations )%>

	<input type="submit" value="Sauvegarder" />
<%= end_form_tag %>
-----------LIST.RHTML-------------
with this partial:

<p> concept:<%= h(variation.concept.name) %>
	variation francaise:<%= text_field "variation", "text_fr","index" =>
variation.id %>
	variation anglaise:<%= text_field "variation", "text_en","index" =>
variation.id %>
</p>

*************

using the previous code, I can update the database but when I call the
LIST page the fields arent updated with the default value from
@variations. why?!?

Thanks a lot for the help!
Alain (Guest)
on 2006-04-13 05:38
Since no one answered teh question, I guess its not the 'normal' way to
do this thing. Anyone has a suggestion or code example on how partials
can show the default value of a collections of items?

Thanks!
This topic is locked and can not be replied to.