Module: Admin::PrototypesHelper
- Defined in:
- app/helpers/admin/prototypes_helper.rb
Instance Method Summary collapse
- #cancel_button(label, div_id, show = nil, hide = nil) ⇒ Object
- #exclusive_properties(prototype, properties) ⇒ Object
Instance Method Details
#cancel_button(label, div_id, show = nil, hide = nil) ⇒ Object
2 3 4 5 6 7 8 |
# File 'app/helpers/admin/prototypes_helper.rb', line 2 def (label, div_id, show=nil, hide=nil) onclick = %Q{Element.update('#{div_id}','');} onclick += %Q{Element.show('#{show}');} if show onclick += %Q{Element.hide('#{hide}');} if hide %Q{<button type="reset" onClick="#{onclick}">#{label}</button>} end |
#exclusive_properties(prototype, properties) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'app/helpers/admin/prototypes_helper.rb', line 10 def exclusive_properties(prototype, properties) prototype.properties.each do |prop| logger.debug("proto property: #{prop.inspect}") properties.delete(prop) # properties = properties.delete_if { |p| p.id == pp.product_property_id } end properties end |