Guest User

Untitled

a guest
Mar 23rd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. class BlogsController < ApplicationController
  2. before_action :check_authorization
  3. ...
  4.  
  5. private
  6. def check_authorization
  7. authorize :blog
  8. end
  9. end
  10.  
  11. def check_authorization
  12. authorize @blog
  13. end
  14.  
  15. class SomeOtherBlogsController < ApplicationController
  16. before_action :check_authorization
  17. ...
  18.  
  19. private
  20. def check_authorization
  21. authorize :some_other_blog, @blog
  22. end
  23. end
Add Comment
Please, Sign In to add comment