Hello
I would like to submit my form with a select
<% form_for :pay , @pay, :url => sort_pays_path, :html => { :method
=>
:put } do |f| %>
<%= f.select :CodePays, @pays.collect {|c| [ c.LibelleFr, c.CodePays ]
}, { :selected => "FR" } %>
<%= f.select :zones , @france.zones.collect {|c| [ c.Libelle,
c.IDZoneGeographique ] } , {:onChange =>
''this.form.submit();'' }%>
<%= f.select :villes , @france.code_postaux.collect {|c| [ c.ville,
c.IDCodePostal ] } %>
<% end %>
Nothing is hapening
I don''t see nothing my html source
<form action="/pays;sort" method="post"><div
style="margin:0;padding:0"><input name="_method"
type="hidden"
value="put" /></div>
<select id="pay_CodePays"
name="pay[CodePays]"><option value="FR"
selected="selected">FRANCE</option></select>
<select id="pay_zones" name="pay[zones]"><option
value="0">AIN</option>
<option value="1">Aisne</option></select>
<select id="pay_villes"
name="pay[villes]"><option
value="0">BOURG-EN-BRESSE</option>
<option value="1">Laon</option></select>
</form
Lil help thanks
--
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
-~----------~----~----~----~------~----~------~--~---
On Dec 20, 2:22 pm, bolo <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> <%= f.select :CodePays, @pays.collect {|c| [ c.LibelleFr, c.CodePays ]}, { :selected => "FR" } %> <%= f.select :zones , @france.zones.collect {|c| [ c.Libelle, > c.IDZoneGeographique ] } , {:onChange => ''this.form.submit();'' }%> > <%= f.select :villes , @france.code_postaux.collect {|c| [ c.ville, > c.IDCodePostal ] } %>Try using :onchange :onChange != :onchange Aaron --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hello arron
So i changer for
<%= f.select :zones , @pay.zones.collect {|c| [ c.Libelle,
c.IDZoneGeographique ] }, {:onchange =>
''this.form.submit();'' } %>
But Nothing and more i don''t see the code in my html view
<select id="pay_zones" name="pay[zones]"><option
value="0">AIN</option>
<option value="1">Aisne</option></select>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
On Dec 21, 8:51 am, "Bolo" <mala...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello arron > > So i changer for > <%= f.select :zones , @pay.zones.collect {|c| [ c.Libelle, > c.IDZoneGeographique ] }, {:onchange => ''this.form.submit();'' } %>I think :onchange belongs in the html_options filed of the select call instead of the options field. Try this: <%= f.select :zones , @france.zones.collect {|c| [ c.Libelle, c.IDZoneGeographique ] }, {}, {:onChange => ''this.form.submit();'' }%> Aaron --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thanks it''s working --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---