However, I wanted more customization though. What if I didn't want to wrap my admin_area in a div? What if I wanted to add conditions on the fly and not make a zillion [enter_some_name]_area methods?
This would be particularly useful if, for example, I only want the "delete" option of an object to appear to admins and if the object if destroyable.
In haml:
- admin_area(:conditions => @object.destroyable?) do
= link_to "Destroy", ...
Take a look at my helper method to see what I did. I'd appreciate any comments!
1 comment:
Thanks! Exactly what I was looking for! :)
Post a Comment