Ruby on Rails Monday, May 29, 2017

On 28 May 2017 at 23:26, fugee ohu <fugee279@gmail.com> wrote:
>
>
> On Sunday, May 28, 2017 at 4:58:13 PM UTC-4, Colin Law wrote:
>>
>> On 28 May 2017 at 21:17, fugee ohu <fuge...@gmail.com> wrote:
>> > I wanna add a dropdown menu to my index view for the index action of my
>> > artists_controller Trying to use collection_select but it responds
>> > undefined
>> > method `collection_select' for nil:NilClass The idea is to list artists
>> > by
>> > genre
>> >
>> > <div class="field"> <%= f.collection_select( :artist, :genre, Genre.all,
>> > :id, :name) %> </div>
>>
>> How are you setting f?
>>
>> Colin
>
>
> <%= form_tag(artists_path) do |f| %>

form_tag must be used inside a form, it does not create a form

Colin

>
>
> --
> 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/1340f13b-8e7c-4e81-a63d-e28833acf816%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

--
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/CAL%3D0gLs6LG9Ranzd_8H3o%2BcMSN6Td7%3Dqqxvj9UEQ0qqbNLQO9A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment