loading...

re: What's the best way to render specific items from a Rails collection? VIEW POST

TOP OF THREAD FULL DISCUSSION
re: What about... In the controller: @cocktails = Cocktail.for_sale.to_a # for_sale scope or whatever, solidified as Array. Helper: def cockta...
 

Ok, that makes sense. Scopes and pluck are definitely very useful features to know about. Is there any specific reason that you're sticking to using an array rather than converting to a hash? Or just because arrays are simpler to get to?

code of conduct - report abuse