cancan
One role per user CanCan, undefined method 'role' problem
Really confused. Roles are set up and working nicely following the one role per user method. My user model is below.[详细]
2023-04-02 06:34 分类:问答Cancan not loading nested resources as I expect it to
Cancan is working fine when user\'s are logged in. But when a user is a \"guest\" I would like them to be able to see some photos, but not those where the Photo\'s parent Post has a restriction employ[详细]
2023-04-01 20:42 分类:问答Rails: authorizing user with CanCan gem issue
I have an action in my controller that looks like the following: def show @user = User.find(params[:user_id])[详细]
2023-04-01 09:34 分类:问答How do I authorize this with CanCan?
I have a method that looks like the following in my controller: def some_request user = User.find(params[:friend_user_id])[详细]
2023-03-31 10:37 分类:问答Rails Beginner Testing Question for RSpec with CanCan
I am currently using cancan with rspec. Please take a look at my ability.rb require \'spec_helper\' require \"cancan/matchers\"[详细]
2023-03-31 08:15 分类:问答RSPEc - undefined method `stubs' for #<RoomsController:0x0000010534c050>
I\'m trying to write an rspec for my Rooms controller t开发者_JAVA百科o test permissions with CanCan but keep getting the error in the title. I\'m following the steps here under Controller Testing: ht[详细]
2023-03-30 21:49 分类:问答CanCan, different between index and show?
I have the following in ability.rb can :index, Thread can :sh开发者_如何学运维ow, Thread do |thread|[详细]
2023-03-30 17:01 分类:问答syntax error, unexpected kEND in active_record/attribute_methods/read.rb
I\'m setting up a working application on a new environment, and after running \'bundle install\' I try to launch an application.[详细]
2023-03-30 10:47 分类:问答cancan: Storing in the database vs accessible_by?
We have a UI that lets admins change permissions on our users. So we store these permissions in the database.[详细]
2023-03-30 05:04 分类:问答In cancan, how to check if can? manage each and every record for a given model
My admin can :manage, Widget My user can :manage, Widget, :user_id => user.id In my view, I want to show a link only开发者_开发知识库 if the current_user can manage each and every Widget record.[详细]
2023-03-30 00:35 分类:问答