Parcourir la source

Specify where to define before_action method in README under Authentication > Other (#162)

Justin Faulkner il y a 7 ans
Parent
commit
9ea9599eaa
1 fichiers modifiés avec 8 ajouts et 0 suppressions
  1. 8 0
      README.md

+ 8 - 0
README.md

@@ -153,6 +153,14 @@ Specify a `before_action` method to run in `blazer.yml`.
 ```yml
 before_action: require_admin
 ```
+Then define the custom authentication method in your `application_controller.rb`.
+
+```ruby
+def require_admin
+  # depending on your auth, maybe something like...
+  current_user && current_user.admin?
+end
+```
 
 ## Queries