Sha256: 0b5d9965e946aef3c024eae11f927cc2f2c362eedc6329c0ac135f3b26f24234

Contents?: true

Size: 418 Bytes

Versions: 4

Compression:

Stored size: 418 Bytes

Contents

module TabsHelper
  # Create a tab as <li> and give it the id "current" if the current action matches that tab
  def tab(name, url, options = {})
    if controller.action_name =~ (options[:highlight] = /#{name}/i)
      content_tag :li, link_to(options[:label] || name.to_s.capitalize, url, {:id => "current"})
    else
      content_tag :li, link_to(options[:label] || name.to_s.capitalize, url)
    end    
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
shopify_app-1.0.1 lib/generators/shopify_app/templates/app/helpers/tabs_helper.rb
shopify_app-1.0.0 lib/generators/shopify_app/templates/app/helpers/tabs_helper.rb
shopify_app-0.1.4 lib/generators/shopify_app/templates/app/helpers/tabs_helper.rb
shopify_app-0.1.0 lib/generators/shopify_app/templates/app/helpers/tabs_helper.rb