There it goes the example. Sorry, I did not know how to format.
def self.get_order_assets(od_id)
return OrderAsset.select("assets.file_name,
order_assets.*").joins("INNER JOIN assets ON assets.id =
order_assets.asset_id ").where("order_detail_id=#{od_id}")
end
def get_order_assets(od_id)
oa =OrderAsset.select("order_assets.*").where("order_detail_id =
#{od_id}")
return oa
end
> There is 2 more things about helpers:
>
> - First your helpers should be something really small, if you need too
> many
> functions, your doing something wrong, either you need to pass something
> to
> the models or build decorators.
>
> - Another thing is: can you give me an example of a helper you need to
> set
> the same name for? I mean is that gonna happen that often?
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5fccfb94216a43e92bfad1d6c0346f43%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment