Re: [Rails] One model, two registrations, one form

2014-02-08 Thread Walter Lee Davis
There is also the nested form setup, but your objects will need a common parent. Can you sketch out your use-case, including any related models? There may be a simple solution that your question doesn't trigger in those of us who have read it. Walter On Feb 8, 2014, at 5:02 AM, Phillip wrote:

[Rails] Re: Hartl RoR tutorial Section 5.3.4

2014-02-08 Thread Colin Mr.
I just want to add to this because this has been driving me nuts. I found my fix. Which was simply making sure my spec/support/utilities.rb file included the ".rb" on utilities file. I was leaving of the .rb So simple yet so stupid of me, anyway hope this helps someone in the future. -- Po

[Rails] Re: Rails shared helpers within views conflict

2014-02-08 Thread andreo
Is this 2 methods inside of which files? To start I dont see the point of the select here: oa =OrderAsset.select("order_assets.*").where("order_detail_id = #{od_id}") this is the same as oa =OrderAsset.where("order_detail_id = #{od_id}") Second thing, you should use a scope for this

[Rails] Re: Rails shared helpers within views conflict

2014-02-08 Thread Rodrigo Lueneberg
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)

[Rails] Re: Rails shared helpers within views conflict

2014-02-08 Thread andreo
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 se

[Rails] Re: One model, two registrations, one form

2014-02-08 Thread Phillip
The most direct way is to forget Rails and use HTML with or without ActionView::Helpers::FormTagHelper . On Friday, February 7, 2014 5:24:46 PM UTC-5, Ruby-Forum.com User wrote: > > Hi, how can i register two rows of the sa