Sha256: 405bbdaa4c0c5b60a2e2a75a20926df75b7f1f21d9453e8552a5da7d0702f0a5

Contents?: true

Size: 996 Bytes

Versions: 22

Compression:

Stored size: 996 Bytes

Contents

module Binco
  module ButtonHelper
    def button(title, options = {})
      options[:type] ||= :default
      options[:class] ||= ''
      options[:class] << ' ' if options[:class].length > 1
      options[:class] << "btn btn-#{options[:type]}"
      content_tag :button, title, options.except(:type)
    end

    def button_primary(title, options = {})
      options[:type] = :primary
      button(title, options)
    end

    def button_default(title, options = {})
      options[:type] = :default
      button(title, options)
    end

    def button_success(title, options = {})
      options[:type] = :default
      button(title, options)
    end

    def button_info(title, options = {})
      options[:type] = :info
      button(title, options)
    end

    def button_warning(title, options = {})
      options[:type] = :warning
      button(title, options)
    end

    def button_danger(title, options = {})
      options[:type] = :warning
      button(title, options)
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

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