I just setup a basic rails wiki app. Where user comes in and creates a wiki. And i also just setup devise. Now i am wondering how do i show only those wikis creating by the specific logged in user ?
Update : I have setup the wiki. using scaffold. And have setup the devise authentication. And i just wondering should i be setting up an association between the wiki model and the user model ?
or how should i proceed with the problem mentioned ?
Thanks
Devise provides a convenience method called
current_userthat retrieves the currently logged in user.Assuming you have your models setup correctly, retrieving the wikis created by a user should be as easy as
current_user.wikis