I'm trying to implement some type of users so ones can edit data and other can only read.
user.rb
class User < ActiveRecord::Base
has_secure_password
validates_presence_of :email, :password, :on => :create
end
I'm using has_secure_password(I followes http://railscasts.com/episodes/270-authentication-in-rails-3-1?view=asciicast) for sessions and I found cancan but I found this:
http://rubygems.org/gems/cancan and http://rubygems.org/gems/cancancan
so, what is the difference? which must I use?
is this guide for rails 3.1 and cancan a good start point or should I look for another approach?
I'm newbie with rails, thanks in advance.
The CanCan project is dead and CanCanCan is a separate project to make a similar authorization solution for Rails 4. In short, CanCan is suitable for Rails 3 apps and CanCanCan is suitable for Rails 4 apps. Here is another Stackoverflow answer with some more information about CanCan / CanCanCan.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With