[Rails] Re: Controller DRYness question

2008-11-16 Thread Justin Holzer
Nick, Thanks again for the reply. I think I will probably go back to using either protected controller methods or helper methods to fetch the reference data. I agree with you 100% in that this type of logic simply has no place in the view. As for my statement regarding the framework lacking a w

[Rails] Re: Controller DRYness question

2008-11-16 Thread Nick Hoffman
G'day Justin. > That's a great suggestion. I would actually prefer using a helper > method over putting the call to ModelObject#find in the view itself. > Something about calling find directly from the view just doesn't feel > right to me. The only reason I'm not 100% opposed to it is because a >

[Rails] Re: Controller DRYness question

2008-11-16 Thread Justin Holzer
Nick, That's a great suggestion. I would actually prefer using a helper method over putting the call to ModelObject#find in the view itself. Something about calling find directly from the view just doesn't feel right to me. The only reason I'm not 100% opposed to it is because a call to find is u

[Rails] Re: Controller DRYness question

2008-11-11 Thread Nick Hoffman
Elias Orozco wrote: > Hey Justin, > > I'll recommend that every data used to load drop down lists on the > views should be loaded on the views, that avoids repetition on the > controllers. For example a list of post categories you can load it > like this: > > <%= collection_select(:post, :post_c

[Rails] Re: Controller DRYness question

2008-11-10 Thread elioncho
Hey Justin, I'll recommend that every data used to load drop down lists on the views should be loaded on the views, that avoids repetition on the controllers. For example a list of post categories you can load it like this: <%= collection_select(:post, :post_category_id, PostCategory.find(:all),

[Rails] Re: Controller DRYness question

2008-11-10 Thread Ar Chron
ck.> > Anyhow, my current ideas for solutions, none of which I really like, > are as follows: > 1. In the "create" and "update" actions, call the filter methods > prior to rendering the new/edit views (don't like this, since if > additional reference data is added later, I will have to add/remov