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
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
2 matches
Mail list logo