Module: Alchemy::Custom::Model::Admin::OrdersHelper
- Defined in:
- app/helpers/alchemy/custom/model/admin/orders_helper.rb
Class Method Summary collapse
Instance Method Summary collapse
- #index_ordered_path(obj = nil, options = {}) ⇒ Object
- #order_path(options = {}) ⇒ Object
- #print_order_identify(el) ⇒ Object
- #print_sort_icon(el) ⇒ Object
- #printelement_to_order(el) ⇒ Object
- #update_order_path(obj = nil, options = {}) ⇒ Object
Class Method Details
.included(mod) ⇒ Object
3 4 5 6 7 8 |
# File 'app/helpers/alchemy/custom/model/admin/orders_helper.rb', line 3 def self.included(mod) if ::Rails.application.config.action_controller.include_all_helpers!=false raise "Devi definire in config/application.rb config.action_controller.include_all_helpers=false in modo da far funzionare correttamente l'override degli helper come per i controller" end end |
Instance Method Details
#index_ordered_path(obj = nil, options = {}) ⇒ Object
14 15 16 17 18 19 20 |
# File 'app/helpers/alchemy/custom/model/admin/orders_helper.rb', line 14 def index_ordered_path(obj = nil, = {}) if obj.nil? polymorphic_path([:admin, base_class], ) else polymorphic_path([:admin, obj], ) end end |
#order_path(options = {}) ⇒ Object
10 11 12 |
# File 'app/helpers/alchemy/custom/model/admin/orders_helper.rb', line 10 def order_path( = {}) new_polymorphic_path([:admin, base_class.to_s.pluralize.underscore.to_sym, :order], ) end |
#print_order_identify(el) ⇒ Object
31 32 33 |
# File 'app/helpers/alchemy/custom/model/admin/orders_helper.rb', line 31 def print_order_identify(el) "el_#{el.id}" end |
#print_sort_icon(el) ⇒ Object
41 42 43 44 45 |
# File 'app/helpers/alchemy/custom/model/admin/orders_helper.rb', line 41 def print_sort_icon(el) content_tag(:span, class: "icon") do content_tag(:i, nil, {class: "fa fa-arrow-right"}) end end |
#printelement_to_order(el) ⇒ Object
35 36 37 38 39 |
# File 'app/helpers/alchemy/custom/model/admin/orders_helper.rb', line 35 def printelement_to_order(el) content_tag(:span, class: "el_title name") do el.name end end |
#update_order_path(obj = nil, options = {}) ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'app/helpers/alchemy/custom/model/admin/orders_helper.rb', line 22 def update_order_path(obj=nil, = {}) if obj.nil? polymorphic_path([:admin, base_class.to_s.pluralize.underscore.to_sym, :order], ) else polymorphic_path([:admin, obj, :order], ) end end |