Sha256: 6e74d6d7952b0eaef891635006b2c35bd8a4e3076b4c6d3ad4831d5f35bb5ac5

Contents?: true

Size: 286 Bytes

Versions: 11

Compression:

Stored size: 286 Bytes

Contents

module DataAttributeHelper
    def page_data_attr
        controller_array = controller.controller_path.split("/").map(&:camelize).join("_")
        action = controller.action_name.capitalize
        "data-controller='#{controller_array}' data-action='#{action}'".html_safe
    end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
seed_tray-0.6.0 lib/seed_tray/data_attribute_helper.rb
seed_tray-0.5.0 lib/seed_tray/data_attribute_helper.rb
seed_tray-0.4.1 lib/seed_tray/data_attribute_helper.rb
seed_tray-0.4.0 lib/seed_tray/data_attribute_helper.rb
seed_tray-0.3.0 lib/seed_tray/data_attribute_helper.rb
seed_tray-0.2.3 lib/seed_tray/data_attribute_helper.rb
seed_tray-0.2.2 lib/seed_tray/data_attribute_helper.rb
seed_tray-0.2.1 lib/seed_tray/data_attribute_helper.rb
seed_tray-0.2.0 lib/seed_tray/data_attribute_helper.rb
seed_tray-0.1.2 lib/seed_tray/data_attribute_helper.rb
seed_tray-0.1.1 lib/seed_tray/data_attribute_helper.rb