fwt_bootstrap_rails 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c34d2f4dc5eaaee1dce7222bd06607f683d215b5
|
4
|
+
data.tar.gz: 367c95965c464d0634eb55f1ef088460d1bef675
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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)
|
@@ -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
|
+
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-
|
11
|
+
date: 2014-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sass-rails
|