[Rails] Re: select an existing item or create a new one

2010-04-07 Thread g_f
It sounds like you are looking for something like ActiveRecord's find_or_create_by...() or find_or_initialize_by...() methods. You might look into Dynamic attribute-based finders on http://api.rubyonrails.org/classes/ActiveRecord/Base.html -- You received this message because you are subscribed

[Rails] Re: select an existing item or create a new one

2010-04-07 Thread keavy
Thanks for your reply. Yeah I didn't think that was suitable in this case, with several fields, showing the user both options in the form etc. Anyway, I just figured out the issue... I was using resource_controller and was trying to delete the nested attributes (if not required) in a