The explanation from api.rubyonrails.org is rather baffling for a newbie like me,

 

collection_select(object, method, collection, value_method, text_method, options = {}, html_options = {})

 

Still managed to get the dropdown menu working for my application after searching through the web. There are already quite a few useful resources available in the net for helper method collection_select.

  

But I seem to lost in the code again looking back at it after a while. And am too lazy to look through all the stuff again. So I try to make a diagram to put down what I already understand from those resources. Might not be the best or complete explanation, but just try to help myself to be able to view it and quickly get a grasp of it.

collection_select_explain_3

 

 

3 Responses to “Rails collection_select helper”

  1. Chris Says:

    Have to say this is not the most comprehensive collection_select post out there BUT it is straight to the point and illustrates the theory perfectly. Good job

  2. admin Says:

    Thansk Chris…glad if it did help someone to understand it better.

  3. Ben R Says:

    You just saved my life. The ‘method” thing was killing me. Read this and it works.
    Thank you. Ben

Leave a Reply