I am using Devise and interested in using Pundit but cannot find much on if it should be integrating with Rolify or if it is stand alone. CanCanCan works nicely with Rolify and I like the roles model. Am I missing a major reason why Pundit and Rolify do not seem to be used together a lot?
相关问题
- Strong parameter override for DeviseTokenAuth cont
- Mechanize getting “Errno::ECONNRESET: Connection r
-
undefined method `type_cast' for #
- Rails- customize view of confirm dialog box before
- ActiveModel::Serializer in Rails - serializer meth
相关文章
- “No explicit conversion of Symbol into String” for
- form_for wrong number of arguments in rails 4
- Rspec controller error expecting <“index”> but
- Google OAuth 2 redirect_uri_mismatch - OmniAuth Ra
- Sending Devise emails through Resque
-
553 5.7.1
: Sender address rejected: not - Rails 4 app on Heroku is 500ing, but no error mess
- Creating multiple nested forms using simple_form a
Why don't use them together? They can be easily used in a fashion like this
In fact, the thing that
rolify
andpundit
are not coupled is something nice, and not a design failure ;)I recently used Pundit gem with Rails 4 using devise.Pundit is standalone system with no dependency on Rolify as per my experience.
Instead of using Rolify, I created migration to add roles in the existing devise user table which helps you to assign roles to users and check which roles they have.
Please take a look at the schema that I created for my project:
Where
is_admin
andis_daily_user
field is added for user roles.Hope this helps!