I have two Models:
Users, and Articles
Every user is able to create an article but can only edit his own Articles?
Can someone provide an example of that? (Model, Controller and View Please?)
Thanks
EDIT
I do not want the whole code. I can get the most of the code using scaffolding. I need the modifications that I have to do to achieve that. My biggest concern is how to allow only the author of an article to edit it. That’s what I am asking.
Assuming an Article
belongs_to :userand you have an authentication setup that gives you acurrent_usermethod, you should be able to do something like this in your ArticlesController:You would also need something similar for your
updatemethod.