Results 1 to 2 of 2
Apr 20, 2008, 07:22 #1
- Join Date
- Jul 2006
- 0 Post(s)
- 0 Thread(s)
restful_authentication and authentication plugin usage
I have installed restful_authentication and authentication plugin
( http://code.google.com/p/rails-authorization-plugin/ ) Login, signup
and activation is working, but I find it very difficult to take it
futher from here.
How do I check if a user is logged in and redirect to /login if not?
(for all actions in my messages controller)
The authorization plugin has added a roles table, does anyone have an
example on how to use such a role? Should I add thoose roles from
mysql or the console?
What I am trying to do is very basic - the logged in user should only
CRUD his/her own records /objects. How should that be implemented?
This is an example:
def edit @blog = Blog.find(params[:id]) end def update @blog = Blog.find(params[:id]) if @blog.update_attributes(params[:blog]) redirect_to :controller => 'blogs', :action => 'show', :id => @blog else render :action => 'edit' end end
Hope that any of you can help me out here. I am a bit stuck and been
working on this all weekend.