wrong # or arguments.

On Jul 2, 11:20 am, Onur Gungor <[email protected]>
wrote:
> Janna Brossard wrote:
> > I have a partial in my view which has a select box:
>
> > <% form_for :channels, :html => {:name => 'channelsform'},:url=>
> > { :action =>"newchannel", :controller =>"channels"} do |f| %>
>
> > <%= f.select(:id , Channel.find(:all,  :order => 'channel
> > ASC',  :conditions => ['deleted=0']).collect {|p| [ p.channel,
> > p.id ]}, {:include_blank => true}, { :onchange =>
> > "document.channelsform.submit();"}) %>
>
> > In  my ChannelsController I pick up the value from this select box
> > correctly as: @channel = Channel.find(params[:channels][:id])
>
> > However, when the partial rerenders, it doesn;t show the selected
> > value. How can I make it show the selected value, given the syntax for
> > the form.select I have used?
>
> > Thanks, Janna B
>
> What I read from the documentation: select
> (ActionView::Helpers::FormOptionsHelper)
>
> "The option currently held by the object will be selected, provided that
> the object is available."
>
> Maybe you must use, while you have populated the object @channel in the
> controller rendering that view.
>
> <%= f.select("channel", "id" , Channel.find(:all,  :order => 'channel
> ASC',  :conditions => ['deleted=0']).collect {|p| [ p.channel,
> p.id ]}, {:include_blank => true}, { :onchange =>
> "document.channelsform.submit();"}) %>
>
> I am not sure but you may give it a ride.
> --
> Posted viahttp://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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to