I have the follwoing select in my view
<%= select(''role'', ''name'',
Role::DEFAULT_COMPANY_NAMES, { :prompt =>
l(:select_a_role) }, {:style => ''width:150px;''}) %>
<%= select(''role'', ''company_id'',
@company_choices, { :prompt =>
l(:select_a_company) }, {:style => ''width:200px;''})
%></p>
on first display I have the prompt, Ok
but when the user forget to select one of 2 seeltions, I would like
to redisplay the already selected one...
I tried
@role_name = params[:role][:name]
@role_company_id = params[:role][:company_id]
before redisplay but no pre-selctiuon is being made ( because of the
prompt... ??)
thanks
erwin
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
this works on your model. so you need something like @role = Role.new(:name => params[:role][:name], :company_id => params[:role][:company_id]) --~--~---------~--~----~------------~-------~--~----~ 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 30 juin, 22:22, Thorsten Müller <thors...-1oxKqHKwyltBDgjK7y7TUQ@public.gmane.org> wrote:> this works on your model. > so you need something like > @role = Role.new(:name => params[:role][:name], :company_id => > params[:role][:company_id])yes .. I see , need to eliminate the prompt.. thanks --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---