Skip to content
This repository
Browse code

Update README

  • Loading branch information...
commit 35a4a4fa74ccb8b9b1b6874276150f3532e7ac05 1 parent 96bf4bf
Nathan Long authored February 12, 2013

Showing 1 changed file with 13 additions and 0 deletions. Show diff stats Hide diff stats

  1. 13  README.markdown
13  README.markdown
Source Rendered
@@ -369,6 +369,19 @@ class LlamasController < ApplicationController
369 369
 end
370 370
 ```
371 371
 
  372
+Finally, note that if you have a controller that dynamically determines the class it's working with, you can pass the name of a controller instance method to `authorize_actions_for` instead of a class, and the class will be looked up when a request is made.
  373
+
  374
+```
  375
+class LlamasController < ApplicationController
  376
+
  377
+  authorize_actions_for :llama_class
  378
+
  379
+  def llama_class
  380
+    [StandardLlama, LludicriousLlama].sample
  381
+  end
  382
+end
  383
+```
  384
+
372 385
 <a name="views">
373 386
 ### Views
374 387
 

0 notes on commit 35a4a4f

Please sign in to comment.
Something went wrong with that request. Please try again.