[Rails] Re: ROR Newb question - multiple models, one form / populating drop-downs from tables

2009-12-10 Thread Andrew Pace
I agree with Colin above. Make a model level method to return the data you wish to use in the view. Then within the view call ValidValues.method_you_make. Like he said, another option is to put this code in the controller, but most of the time, the dropdown select menus have little to do with th

Re: [Rails] Re: ROR Newb question - multiple models, one form / populating drop-downs from tables

2009-12-10 Thread Colin Law
2009/12/10 SMR : > Many Thanks, Andrew. > > The drop down is actually simpler than you indicated - it is all > string text that was validated on input. All I need to do is "select * > from valid_values where dropdown_to_be_populated = 'status' " and > populate the returned array of strings into the

[Rails] Re: ROR Newb question - multiple models, one form / populating drop-downs from tables

2009-12-10 Thread SMR
Many Thanks, Andrew. The drop down is actually simpler than you indicated - it is all string text that was validated on input. All I need to do is "select * from valid_values where dropdown_to_be_populated = 'status' " and populate the returned array of strings into the dropdown. My confusion - w

[Rails] Re: ROR Newb question - multiple models, one form / populating drop-downs from tables

2009-12-09 Thread Andrew Pace
There are many approaches to this problem. Some involve setting up the code in the controller, others use a "presenter." Google presenter pattern for more info on that. The "build" method might be what you are looking for. This is created as you define your model relationships. If you use it,