I created 2 models usin开发者_开发百科g scaffolding with Rails 3. The models are Locations and Jobs and each job has a location.
I created the required reference calls in the scaffold generation code but when I look at the view to create a new job, all I see is a textbox where I should add the location_id.
How can I get that to be a dropdown instead for a better user experience?
Imagine, that you have got title for each location
<%= f.collection_select :location_id, Location.all, :id, :title %>
API: http://apidock.com/rails/ActionView/Helpers/FormOptionsHelper/collection_select
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论