I have a form for @topic that contains two fields, name(string)
visible(boolean)

When the user submits the form, I want to manipulate the contents of the
attribute :name (which I am able to do - but it's the next part I'm
stuck on)

-and then-
see if a record with the contents of :name already exists

-if it already exists-
I want to simple add my user association to it (which I can do by:
current_user.topics << @topic)

-if it does not exist-
then I want to create it as normal

find_or_create_by_name(params:topic) doesn't seem to work... are there
any other ways to achieve this?

(nube alert!)

Thanks in advance.

-- 
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to