Sha256: faa6131d8c1d731ee8d6982aa49a98732f525d46cdaf69753afed2df436a30f7

Contents?: true

Size: 486 Bytes

Versions: 8

Compression:

Stored size: 486 Bytes

Contents

# frozen_string_literal: true

module ApplicationHelper
  def body_id
    ctrl_name = controller_path.gsub(%r{^v\d+/}, '').tr('/', '-')
    [ctrl_name, action_name].map(&:dasherize).join('-')
  end

  def body_class
    controller_path.gsub(%r{^v\d+/}, '').tr('/', '-').dasherize
  end

  def body_data_controller
    @body_data_controller ||= controller_name.tr('_', '-').split('/').join('-')
  end

  def sort_opt(model, column)
    { model: model, column: column }.to_json
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rails_material_admin-0.1.7 app/helpers/admin_helper.rb
rails_material_admin-0.1.6 app/helpers/admin_helper.rb
rails_material_admin-0.1.5 app/helpers/admin_helper.rb
rails_material_admin-0.1.4 app/helpers/admin_helper.rb
rails_material_admin-0.1.3 app/helpers/admin_helper.rb
rails_material_admin-0.1.2 app/helpers/admin_helper.rb
rails_material_admin-0.1.1 app/helpers/admin_helper.rb
rails_material_admin-0.1.0 app/helpers/admin_helper.rb