Class: ActionView::Helpers::FormBuilder
- Inherits:
-
Object
- Object
- ActionView::Helpers::FormBuilder
- Defined in:
- lib/cancan_edit/edit_additions.rb
Instance Method Summary collapse
- #check_box_with_cancan(method, options = {}, checked_value = "1", unchecked_value = "0") ⇒ Object
- #radio_button_with_cancan(method, tag_value, options = {}) ⇒ Object
Instance Method Details
#check_box_with_cancan(method, options = {}, checked_value = "1", unchecked_value = "0") ⇒ Object
12 13 14 15 |
# File 'lib/cancan_edit/edit_additions.rb', line 12 def check_box_with_cancan(method, = {}, checked_value = "1", unchecked_value = "0") .merge!({:disabled => true}) unless (@template.can_edit? method.to_sym, @object) check_box_without_cancan(method, , checked_value = "1", unchecked_value = "0") end |
#radio_button_with_cancan(method, tag_value, options = {}) ⇒ Object
18 19 20 21 |
# File 'lib/cancan_edit/edit_additions.rb', line 18 def (method, tag_value, = {}) .merge!({:disabled => true}) unless (@template.can_edit? method.to_sym, @object) (method, tag_value, ) end |