collection_select(object, method, collection, value_method, text_method, options = {}, html_options = {})public
for e.g.
collection_select(:post, :author_id, Author.all, :id, :name_with_initial, prompt: true)
In this helper - Please explain, What is object
and method
in detail? Is :post
a model name and :author_id
a fieldname in a model or are they tag name.
can they be anything I want, not necessarily :post
and author_id
, instead :post123
or auth_id
. Will it be perfectly ok?
Please explain be in detail. thanks in advance