Hey guys. 

I'm still a super rails noob, and trying to figure this out in relation to 
learning how to write controllers/models and where stuff should go.

Basically I have my models set up with a many-to-many mapping of API keys 
to users. There's three models here, users, api_keys_users, and 
api_keys. I've got a view/controller setup for the users. But have avoided 
doing it for the api_keys and api_keys_users tables. Manually I can create 
a API key and map it to a user using SQL but now I want to set it up for 
generation via the view.

However I have no idea where the logic should go. Basically I want a 
"generate new api key" button on the show users page. This would create a 
unique entry in the api_key table. Then create an entry in the 
api_keys_users table with the id of the user and the id of the new key.

Any pointers?

-Beau

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/bFQDLWvKSgcJ.
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