Ruby on Rails Tuesday, December 2, 2014

Hassan Schroeder wrote in post #1163871:
> On Tue, Dec 2, 2014 at 5:51 PM, Dmoneyzzz Darko <lists@ruby-forum.com>
> wrote:
>
>> I do understand this. I tried to input f.select or form.select for this
>> array drop down but I recieved an error for both so I left select alone
>> and then it displayed.
>
> "displayed", great, but it doesn't work. Not a good tradeoff :-)
>
> What was the error? What did you find when you googled that error?
> How did your code compare to the documentation for that method?
>
> --
> Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
> http://about.me/hassanschroeder
> twitter: @hassan

undefined method `merge' for #<Array:0x5c68788> in
appointments/_form.html.erb

<%= f.select "appointment_time", "test", timeslots.map.with_index{
|name, index|
[name,
name] } %>

I found other examples undefined method 'merge' but did not find a
solution although I found direction to create my array and array
handling method in the controller. I tried different ways to display
the array dropdown and the code above (without the f.) was the first
time I was able to see the array in dropdown form. It felt like a
relief.

--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a576945bebc00921097e29f634534cb7%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment