On 2 July 2012 10:26, phoe san <li...@ruby-forum.com> wrote:
> <%= collection_select(:sport_name,count,Sport.find( :all, :order => 'id'
> ),
>             :id, :sport_name, {:selected =>@sport_id})%>
>
> Collection_select Value.
> We take data from collection_select by params[:sport_name]
>
> In Controller, we use this
> ps_array = params[:sport_name]
> we get the data
>
> First array method , It doesn't work.
> Second Method , It Work.

Please remember to quote the previous message, remember this is a
mailing list not a forum (though you may be accessing it via a forum
interface).  Now we will have to look back at the previous message to
see your methods.

When you say
arr  = ps_array["1"]
arr is probably a string not an array, so then when you use
arr += ps_array["2"]
it will concatenate the second string onto the first.

Have a look at the Rails Guide on debugging for ideas on how to debug
your code so that you can work out what is going on when you have this
sort of problem.

Colin

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en-US.

Reply via email to