Sha256: 4a3b5e8b089befa0ed537bf35470457bad54f375e1b83c55a610bcb63f89f30f

Contents?: true

Size: 1.49 KB

Versions: 22

Compression:

Stored size: 1.49 KB

Contents

module Binco
  module ButtonLinkHelper
    def button_link_to(name = nil, options = nil, html_options = {}, &block)
      html_options[:type] ||= :default
      html_options[:class] ||= ''
      html_options[:class] << ' ' if html_options[:class].length > 1
      html_options[:class] << "btn btn-#{html_options[:type]}"
      link_to(name, options, html_options.except(:type), &block)
    end

    def button_primary_link_to(name = nil, options = nil, html_options = {}, &block)
      html_options[:type] = :primary
      button_link_to(name, options, html_options, &block)
    end

    def button_default_link_to(name = nil, options = nil, html_options = {}, &block)
      html_options[:type] = :default
      button_link_to(name, options, html_options, &block)
    end

    def button_danger_link_to(name = nil, options = nil, html_options = {}, &block)
      html_options[:type] = :danger
      button_link_to(name, options, html_options, &block)
    end

    def button_warning_link_to(name = nil, options = nil, html_options = {}, &block)
      html_options[:type] = :warning
      button_link_to(name, options, html_options, &block)
    end

    def button_success_link_to(name = nil, options = nil, html_options = {}, &block)
      html_options[:type] = :success
      button_link_to(name, options, html_options, &block)
    end

    def button_info_link_to(name = nil, options = nil, html_options = {}, &block)
      html_options[:type] = :info
      button_link_to(name, options, html_options, &block)
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
binco-4.0.0 app/helpers/binco/button_link_helper.rb
binco-3.5.4 app/helpers/binco/button_link_helper.rb
binco-3.5.2 app/helpers/binco/button_link_helper.rb
binco-3.5.1 app/helpers/binco/button_link_helper.rb
binco-3.5.0 app/helpers/binco/button_link_helper.rb
binco-3.4.0 app/helpers/binco/button_link_helper.rb
binco-3.3.0 app/helpers/binco/button_link_helper.rb
binco-3.2.1 app/helpers/binco/button_link_helper.rb
binco-3.2.0 app/helpers/binco/button_link_helper.rb
binco-2.0.1 app/helpers/binco/button_link_helper.rb
binco-3.1.6 app/helpers/binco/button_link_helper.rb
binco-3.1.5 app/helpers/binco/button_link_helper.rb
binco-3.1.4 app/helpers/binco/button_link_helper.rb
binco-3.1.3 app/helpers/binco/button_link_helper.rb
binco-3.1.2 app/helpers/binco/button_link_helper.rb
binco-3.1.1 app/helpers/binco/button_link_helper.rb
binco-3.1.0 app/helpers/binco/button_link_helper.rb
binco-3.0.2 app/helpers/binco/button_link_helper.rb
binco-3.0.1 app/helpers/binco/button_link_helper.rb
binco-0.0.3 app/helpers/binco/button_link_helper.rb