by gingerlime · 13y ago · 0 comments
Also a good point about the `attr_accessible` concept. It always felt like a bit of a crippled way to perform authorization. That said, I'm not sure this comment is completely valid:
> attr_accessible suffers from context blindness: you’re frequently going to have an end user UI and an admin UI. You want admins to have access to more fields.
Whilst it's not the most elegant, you can (and should) define `attr_accessible :x, :y, :z, :as => :admin`
but you have to remember to use something like `MyObj.create({x: 'a', z: 'b'}, :as => :admin)`