fwt_bootstrap_rails 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 725c27af132eeea0621a982b6da20f1d18754324
4
- data.tar.gz: 349114f421bb20c0452fe2c69a950dcd936fba28
3
+ metadata.gz: c34d2f4dc5eaaee1dce7222bd06607f683d215b5
4
+ data.tar.gz: 367c95965c464d0634eb55f1ef088460d1bef675
5
5
  SHA512:
6
- metadata.gz: a93bdc53b3321638fd1eeee38d11ebf4d35080927e721aa8baeb461115c5f3e480c7bcd31cf7d2c555bcb6cb3ac49d7a3ad6c03847f7d38768e82d97a39bfdb4
7
- data.tar.gz: 97eaa80ac1d7a4eea1fffcbe5ceada5f0be1d7eba99ad06f1a1ee7fba703f5c89cf3acd3390f2643974383d4fe274a98ad8a0e818fbb6855d2e08f661cab8ecb
6
+ metadata.gz: 648a62a12b7976b1c99640b4a7fb9c6d0e2fb4654863b735eb7a659cd92059ab052a9aa2be52c8af2ec78e2b0febfd832649bcbbc4c403949bca47c2bf9b5bc9
7
+ data.tar.gz: e4051710ba250fd38fc8c48f859dbc8ca07cf117b0a1c259872212210a24145d2476f9e2fad0ee482fb50b9f162d1289829f05037fcbce2bf9f34e9011322e4b
@@ -1,7 +1,11 @@
1
1
  module BootstrapHelper
2
2
 
3
3
  def button(path, text, icon, method = :get, size = :sm, data = nil)
4
- link_to raw("<span class='glyphicon glyphicon-#{icon}'></span> #{text}"), path, :class => "btn btn-default btn-#{size}", :method => method, :data => data
4
+ link_to raw("<span class='glyphicon glyphicon-#{icon}'></span> #{text}"), path, :class => "btn btn-default btn-#{size}", :method => method, :data => data
5
+ end
6
+
7
+ def styled_button(path, text, icon, method = :get, size = :sm, data = nil, style)
8
+ link_to raw("<span class='glyphicon glyphicon-#{icon}'></span> #{text}"), path, :class => "btn btn-#{style} btn-#{size}", :method => method, :data => data
5
9
  end
6
10
 
7
11
  def red_delete_button(path, text)
@@ -1,3 +1,3 @@
1
1
  module FwtBootstrapRails
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
@@ -10,4 +10,13 @@ describe BootstrapHelper do
10
10
  end
11
11
 
12
12
  end
13
+
14
+ it "builds a styled button" do
15
+ rendered = helper.styled_button("/root", "Detail", "pencil", :get, :sm, nil, "warning")
16
+
17
+ expect(rendered).to have_tag('a', :with => { :href => '/root', :class => 'btn btn-warning btn-sm', :'data-method' => "get" }) do
18
+ with_tag "span", :with => { :class => "glyphicon glyphicon-pencil" }
19
+ end
20
+
21
+ end
13
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fwt_bootstrap_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Brooke-Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-08 00:00:00.000000000 Z
11
+ date: 2014-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sass-rails