Sha256: e0b474446e54e25da5910d66bc1bd8eade7736f3b72a8d84e15c4e51439c36d8

Contents?: true

Size: 1.12 KB

Versions: 1

Compression:

Stored size: 1.12 KB

Contents

module Alchemy::Custom::Model::Admin::OrdersHelper

  def CustomModelHelper.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

  def order_path(options = {})
    new_polymorphic_path([:admin, base_class.to_s.pluralize.underscore, :order], options)
  end

  def index_ordered_path(obj = nil, options = {})
    if obj.nil?
      polymorphic_path([:admin, base_class], options)
    else
      polymorphic_path([:admin, obj], options)
    end
  end

  def update_order_path(options = {})
    polymorphic_path([:admin, base_class.to_s.pluralize.underscore, :order], options)
  end

  def print_order_identify(el)
    "el_#{el.id}"
  end

  def printelement_to_order(el)
    content_tag(:span, class: "el_title name") do
      el.name
    end
  end

  def print_sort_icon(el)
    content_tag(:span, class: "icon") do
      content_tag(:i, nil, {class: "fa fa-arrow-right"})
    end
  end


end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alchemy-custom-model-2.0.0 app/helpers/alchemy/custom/model/admin/orders_helper.rb