bootstrap-sass-extras 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. checksums.yaml +5 -5
  2. data/.travis.yml +9 -0
  3. data/CHANGELOG.md +48 -5
  4. data/Gemfile +4 -1
  5. data/Gemfile.lock +147 -87
  6. data/README.md +142 -34
  7. data/Rakefile +11 -1
  8. data/app/helpers/badge_helper.rb +13 -0
  9. data/app/helpers/bootstrap_flash_helper.rb +18 -10
  10. data/app/helpers/bootstrap_viewport_meta_helper.rb +27 -0
  11. data/app/helpers/glyph_helper.rb +10 -7
  12. data/app/helpers/modal_helper.rb +19 -15
  13. data/app/helpers/nav_helper.rb +40 -0
  14. data/app/helpers/twitter_breadcrumbs_helper.rb +8 -2
  15. data/app/helpers/url_helper.rb +28 -0
  16. data/app/views/bootstrap_sass_extras/_breadcrumbs.html.erb +6 -0
  17. data/bootstrap-sass-extras.gemspec +1 -0
  18. data/lib/bootstrap-sass-extras/breadcrumbs.rb +57 -0
  19. data/lib/bootstrap-sass-extras/engine.rb +6 -0
  20. data/lib/bootstrap-sass-extras/version.rb +1 -1
  21. data/lib/generators/bootstrap/install/templates/en.bootstrap.yml +1 -0
  22. data/lib/generators/bootstrap/layout/layout_generator.rb +1 -4
  23. data/lib/generators/bootstrap/layout/templates/layout.html.erb +39 -57
  24. data/lib/generators/bootstrap/layout/templates/layout.html.haml +27 -45
  25. data/lib/generators/bootstrap/layout/templates/layout.html.slim +27 -46
  26. data/lib/generators/bootstrap/partial/templates/_login.html.erb +6 -6
  27. data/lib/generators/bootstrap/themed/templates/_form.html.erb +11 -9
  28. data/lib/generators/bootstrap/themed/templates/_form.html.haml +9 -8
  29. data/lib/generators/bootstrap/themed/templates/_form.html.slim +9 -9
  30. data/lib/generators/bootstrap/themed/templates/edit.html.erb +2 -2
  31. data/lib/generators/bootstrap/themed/templates/edit.html.haml +2 -2
  32. data/lib/generators/bootstrap/themed/templates/edit.html.slim +2 -2
  33. data/lib/generators/bootstrap/themed/templates/index.html.erb +16 -14
  34. data/lib/generators/bootstrap/themed/templates/index.html.haml +11 -7
  35. data/lib/generators/bootstrap/themed/templates/index.html.slim +13 -11
  36. data/lib/generators/bootstrap/themed/templates/new.html.erb +2 -2
  37. data/lib/generators/bootstrap/themed/templates/new.html.haml +2 -2
  38. data/lib/generators/bootstrap/themed/templates/new.html.slim +3 -3
  39. data/lib/generators/bootstrap/themed/templates/show.html.erb +19 -17
  40. data/lib/generators/bootstrap/themed/templates/show.html.haml +12 -12
  41. data/lib/generators/bootstrap/themed/templates/show.html.slim +12 -11
  42. data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.erb +9 -7
  43. data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.haml +6 -5
  44. data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.slim +6 -6
  45. data/spec/dummy/README.rdoc +15 -248
  46. data/spec/dummy/Rakefile +1 -2
  47. data/spec/dummy/app/assets/config/manifest.js +3 -0
  48. data/spec/dummy/app/{mailers/.gitkeep → assets/images/.keep} +0 -0
  49. data/spec/dummy/app/assets/javascripts/application.js +4 -6
  50. data/spec/dummy/app/assets/stylesheets/application.css +6 -4
  51. data/spec/dummy/app/controllers/application_controller.rb +3 -1
  52. data/spec/dummy/app/{models/.gitkeep → controllers/concerns/.keep} +0 -0
  53. data/spec/dummy/{lib/assets/.gitkeep → app/mailers/.keep} +0 -0
  54. data/spec/dummy/{log/.gitkeep → app/models/.keep} +0 -0
  55. data/spec/dummy/app/models/concerns/.keep +0 -0
  56. data/spec/dummy/app/views/application/_custom_breadcrumbs.html.erb +1 -0
  57. data/spec/dummy/app/views/layouts/application.html.erb +2 -2
  58. data/spec/dummy/bin/bundle +3 -0
  59. data/spec/dummy/bin/rails +4 -0
  60. data/spec/dummy/bin/rake +4 -0
  61. data/spec/dummy/bin/setup +29 -0
  62. data/spec/dummy/config.ru +2 -2
  63. data/spec/dummy/config/application.rb +1 -37
  64. data/spec/dummy/config/boot.rb +4 -9
  65. data/spec/dummy/config/database.yml +8 -8
  66. data/spec/dummy/config/environment.rb +3 -3
  67. data/spec/dummy/config/environments/development.rb +22 -18
  68. data/spec/dummy/config/environments/production.rb +46 -34
  69. data/spec/dummy/config/environments/test.rb +19 -14
  70. data/spec/dummy/config/initializers/assets.rb +11 -0
  71. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  72. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  73. data/spec/dummy/config/initializers/inflections.rb +6 -5
  74. data/spec/dummy/config/initializers/mime_types.rb +0 -1
  75. data/spec/dummy/config/initializers/session_store.rb +1 -6
  76. data/spec/dummy/config/initializers/wrap_parameters.rb +6 -6
  77. data/spec/dummy/config/locales/en.yml +20 -2
  78. data/spec/dummy/config/routes.rb +23 -25
  79. data/spec/dummy/config/secrets.yml +22 -0
  80. data/spec/dummy/lib/assets/.keep +0 -0
  81. data/spec/dummy/log/.keep +0 -0
  82. data/spec/dummy/public/404.html +54 -13
  83. data/spec/dummy/public/422.html +54 -13
  84. data/spec/dummy/public/500.html +53 -12
  85. data/spec/helpers/badge_helper_spec.rb +16 -0
  86. data/spec/helpers/bootstrap_flash_helper_spec.rb +52 -12
  87. data/spec/helpers/bootstrap_viewport_meta_helper_spec.rb +17 -0
  88. data/spec/helpers/button_to_helper_spec.rb +33 -0
  89. data/spec/helpers/glyph_helper_spec.rb +15 -0
  90. data/spec/helpers/nav_helper_spec.rb +79 -0
  91. data/spec/helpers/twitter_breadcrumbs_helper_spec.rb +161 -0
  92. data/spec/spec_helper.rb +1 -1
  93. metadata +69 -30
  94. data/app/views/twitter-bootstrap/_breadcrumbs.html.erb +0 -14
  95. data/spec/dummy/config/initializers/secret_token.rb +0 -7
  96. data/spec/dummy/script/rails +0 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: a3fb89b0dac2bdbce1b2c0b80f970f8c2f8f4b4f
4
- data.tar.gz: ff4cb7955a581564fa9f33b1e2a7d3cd20bff4a2
2
+ SHA256:
3
+ metadata.gz: 83b3f7ce19029b2f212c749c14e38b51c11ca5478e3f8a8a04494c8644880aa9
4
+ data.tar.gz: 45dc961f7f3616e4e933fb4231855f1c689f2764049e5f7b6ca1ca518fb4cb46
5
5
  SHA512:
6
- metadata.gz: 991f34f1c4b0c695d9aca47d7604fe04b33e5397b807d99940d1f89384c0fe9ba44945a8b30d8e48157ef9c0c409fa6054909fb95d52ea809be7d17cc27953bb
7
- data.tar.gz: 10f5f1afbdbcb87cd455a0cceef1fc73adada250b1a6e2fca9d8e663a1889bc2c182cf3c44de3894c8e13c8591c7b8b098c4ae762da0f825d63676aa0d0c7867
6
+ metadata.gz: ab324f770c30db9789a28a3ee3f3956103ee456f030811f93233c5655fc856ffc5f9648fb1075bdb75461fc61dd0e0ecdaaa5902d9111fb352ad28276c8612a7
7
+ data.tar.gz: d9e551e802d1859661320e1ca9a2ef217c8ab64c92880110197421e8e7b999853ce4537acb632deaf596fca52a7347f9535ecc09a843310136584acb3a1b3b79
@@ -0,0 +1,9 @@
1
+ language: ruby
2
+ cache: bundler
3
+ sudo: false
4
+ rvm:
5
+ - 2.5.7
6
+ - 2.6.5
7
+ before_install:
8
+ - gem update --system
9
+ - bundle update --bundler
@@ -1,14 +1,57 @@
1
1
  # Changelog
2
2
 
3
- ## Relese 0.0.3
3
+ ## Release 0.1.0
4
4
 
5
- * Add glyph, model and breadcrumbs helpers
6
- * Update templates
5
+ - Avoid dangerous calling of methods [@dlackty][]
6
+ - Fix Travis CI [@dlackty][]
7
+ - Add nav_to option to force active state [@sharshenov][]
8
+ - use `before_action` over `before_filter` [@cantonic][]
9
+ - Treat space-separated class names the same as arrays of class names in
10
+ button_to_with_bootstrap [@marcp][]
11
+ - Freeze ALERT_TYPES_MAP to save allocations
12
+
13
+ ## Release 0.0.7
14
+
15
+ - Added the ability to specify a custom view path for breadcrumbs [@fredwu][]
16
+ - Put locale arg for String#pluralize in the view templates [@kayhide][]
17
+ - Fix .haml themed template show.html.haml [@mskubenich][]
18
+ - Augment button_to to generate the `btn` Bootstrap class. [@lowjoel][]
19
+ - Given the nav helper, generate the appropriate Bootstrap tabs markup.
20
+ [@lowjoel][]
21
+ - Allow pills and tabs to be used in the same manner. [@lowjoel][]
22
+
23
+ ## Release 0.0.6
24
+
25
+ - Update to bootstrap 3.0
26
+ - Add a `badge(badge_count)` helper by [@pdobb][]
27
+ - Clean up codes by [@pdobb][]
28
+
29
+ ## Release 0.0.5
30
+
31
+ - Adjust bootstrap_flash to match bootstrap alerts by [@jonwaghorn][]
32
+ - Rails Form Helper for Bootstrap META tag by [@dabit][]
33
+
34
+ ## Release 0.0.4
35
+
36
+ - Fix BreadCrumbs Helper
37
+
38
+ ## Release 0.0.3
39
+
40
+ - Add glyph, model and breadcrumbs helpers
41
+ - Update templates
7
42
 
8
43
  ## Release 0.0.2
9
44
 
10
- * Add layout and views generators
45
+ - Add layout and views generators
11
46
 
12
47
  ## Release 0.0.1
13
48
 
14
- * Initial version
49
+ - Initial version
50
+
51
+ [@lowjoel]: https://github.com/lowjoel
52
+ [@mskubenich]: https://github.com/mskubenich
53
+ [@kayhide]: https://github.com/kayhide
54
+ [@fredwu]: https://github.com/fredwu
55
+ [@jonwaghorn]: https://github.com/jonwaghorn
56
+ [@pdobb]: https://github.com/pdobb
57
+ [@dabit]: https://github.com/dabit
data/Gemfile CHANGED
@@ -3,4 +3,7 @@ source "http://rubygems.org"
3
3
  # Declare your gem's dependencies in bootstrap-sass-extras.gemspec.
4
4
  # Bundler will treat runtime dependencies like base dependencies, and
5
5
  # development dependencies will be added by default to the :development group.
6
- gemspec
6
+ gemspec
7
+
8
+ # gem 'byebug'
9
+ gem 'pry'
@@ -1,107 +1,167 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bootstrap-sass-extras (0.0.1)
4
+ bootstrap-sass-extras (0.1.0)
5
5
  rails (>= 3.1.0)
6
6
 
7
7
  GEM
8
8
  remote: http://rubygems.org/
9
9
  specs:
10
- actionmailer (3.2.13)
11
- actionpack (= 3.2.13)
12
- mail (~> 2.5.3)
13
- actionpack (3.2.13)
14
- activemodel (= 3.2.13)
15
- activesupport (= 3.2.13)
16
- builder (~> 3.0.0)
17
- erubis (~> 2.7.0)
18
- journey (~> 1.0.4)
19
- rack (~> 1.4.5)
20
- rack-cache (~> 1.2)
21
- rack-test (~> 0.6.1)
22
- sprockets (~> 2.2.1)
23
- activemodel (3.2.13)
24
- activesupport (= 3.2.13)
25
- builder (~> 3.0.0)
26
- activerecord (3.2.13)
27
- activemodel (= 3.2.13)
28
- activesupport (= 3.2.13)
29
- arel (~> 3.0.2)
30
- tzinfo (~> 0.3.29)
31
- activeresource (3.2.13)
32
- activemodel (= 3.2.13)
33
- activesupport (= 3.2.13)
34
- activesupport (3.2.13)
35
- i18n (= 0.6.1)
36
- multi_json (~> 1.0)
37
- arel (3.0.2)
38
- builder (3.0.4)
39
- diff-lcs (1.1.3)
40
- erubis (2.7.0)
41
- hike (1.2.1)
42
- i18n (0.6.1)
43
- journey (1.0.4)
44
- json (1.7.7)
45
- mail (2.5.3)
46
- i18n (>= 0.4.0)
47
- mime-types (~> 1.16)
48
- treetop (~> 1.4.8)
49
- mime-types (1.21)
50
- multi_json (1.7.2)
51
- polyglot (0.3.3)
52
- rack (1.4.5)
53
- rack-cache (1.2)
54
- rack (>= 0.4)
55
- rack-ssl (1.3.3)
56
- rack
57
- rack-test (0.6.2)
58
- rack (>= 1.0)
59
- rails (3.2.13)
60
- actionmailer (= 3.2.13)
61
- actionpack (= 3.2.13)
62
- activerecord (= 3.2.13)
63
- activeresource (= 3.2.13)
64
- activesupport (= 3.2.13)
65
- bundler (~> 1.0)
66
- railties (= 3.2.13)
67
- railties (3.2.13)
68
- actionpack (= 3.2.13)
69
- activesupport (= 3.2.13)
70
- rack-ssl (~> 1.3.2)
10
+ actioncable (6.0.3.1)
11
+ actionpack (= 6.0.3.1)
12
+ nio4r (~> 2.0)
13
+ websocket-driver (>= 0.6.1)
14
+ actionmailbox (6.0.3.1)
15
+ actionpack (= 6.0.3.1)
16
+ activejob (= 6.0.3.1)
17
+ activerecord (= 6.0.3.1)
18
+ activestorage (= 6.0.3.1)
19
+ activesupport (= 6.0.3.1)
20
+ mail (>= 2.7.1)
21
+ actionmailer (6.0.3.1)
22
+ actionpack (= 6.0.3.1)
23
+ actionview (= 6.0.3.1)
24
+ activejob (= 6.0.3.1)
25
+ mail (~> 2.5, >= 2.5.4)
26
+ rails-dom-testing (~> 2.0)
27
+ actionpack (6.0.3.1)
28
+ actionview (= 6.0.3.1)
29
+ activesupport (= 6.0.3.1)
30
+ rack (~> 2.0, >= 2.0.8)
31
+ rack-test (>= 0.6.3)
32
+ rails-dom-testing (~> 2.0)
33
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
34
+ actiontext (6.0.3.1)
35
+ actionpack (= 6.0.3.1)
36
+ activerecord (= 6.0.3.1)
37
+ activestorage (= 6.0.3.1)
38
+ activesupport (= 6.0.3.1)
39
+ nokogiri (>= 1.8.5)
40
+ actionview (6.0.3.1)
41
+ activesupport (= 6.0.3.1)
42
+ builder (~> 3.1)
43
+ erubi (~> 1.4)
44
+ rails-dom-testing (~> 2.0)
45
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
46
+ activejob (6.0.3.1)
47
+ activesupport (= 6.0.3.1)
48
+ globalid (>= 0.3.6)
49
+ activemodel (6.0.3.1)
50
+ activesupport (= 6.0.3.1)
51
+ activerecord (6.0.3.1)
52
+ activemodel (= 6.0.3.1)
53
+ activesupport (= 6.0.3.1)
54
+ activestorage (6.0.3.1)
55
+ actionpack (= 6.0.3.1)
56
+ activejob (= 6.0.3.1)
57
+ activerecord (= 6.0.3.1)
58
+ marcel (~> 0.3.1)
59
+ activesupport (6.0.3.1)
60
+ concurrent-ruby (~> 1.0, >= 1.0.2)
61
+ i18n (>= 0.7, < 2)
62
+ minitest (~> 5.1)
63
+ tzinfo (~> 1.1)
64
+ zeitwerk (~> 2.2, >= 2.2.2)
65
+ builder (3.2.4)
66
+ coderay (1.1.2)
67
+ concurrent-ruby (1.1.6)
68
+ crass (1.0.6)
69
+ diff-lcs (1.3)
70
+ erubi (1.9.0)
71
+ globalid (0.4.2)
72
+ activesupport (>= 4.2.0)
73
+ i18n (1.8.2)
74
+ concurrent-ruby (~> 1.0)
75
+ loofah (2.5.0)
76
+ crass (~> 1.0.2)
77
+ nokogiri (>= 1.5.9)
78
+ mail (2.7.1)
79
+ mini_mime (>= 0.1.1)
80
+ marcel (0.3.3)
81
+ mimemagic (~> 0.3.2)
82
+ method_source (0.9.2)
83
+ mimemagic (0.3.5)
84
+ mini_mime (1.0.2)
85
+ mini_portile2 (2.4.0)
86
+ minitest (5.14.1)
87
+ nio4r (2.5.4)
88
+ nokogiri (1.10.9)
89
+ mini_portile2 (~> 2.4.0)
90
+ pry (0.12.2)
91
+ coderay (~> 1.1.0)
92
+ method_source (~> 0.9.0)
93
+ rack (2.2.2)
94
+ rack-test (1.1.0)
95
+ rack (>= 1.0, < 3)
96
+ rails (6.0.3.1)
97
+ actioncable (= 6.0.3.1)
98
+ actionmailbox (= 6.0.3.1)
99
+ actionmailer (= 6.0.3.1)
100
+ actionpack (= 6.0.3.1)
101
+ actiontext (= 6.0.3.1)
102
+ actionview (= 6.0.3.1)
103
+ activejob (= 6.0.3.1)
104
+ activemodel (= 6.0.3.1)
105
+ activerecord (= 6.0.3.1)
106
+ activestorage (= 6.0.3.1)
107
+ activesupport (= 6.0.3.1)
108
+ bundler (>= 1.3.0)
109
+ railties (= 6.0.3.1)
110
+ sprockets-rails (>= 2.0.0)
111
+ rails-dom-testing (2.0.3)
112
+ activesupport (>= 4.2.0)
113
+ nokogiri (>= 1.6)
114
+ rails-html-sanitizer (1.3.0)
115
+ loofah (~> 2.3)
116
+ railties (6.0.3.1)
117
+ actionpack (= 6.0.3.1)
118
+ activesupport (= 6.0.3.1)
119
+ method_source
71
120
  rake (>= 0.8.7)
72
- rdoc (~> 3.4)
73
- thor (>= 0.14.6, < 2.0)
74
- rake (10.0.3)
75
- rdoc (3.12.2)
76
- json (~> 1.4)
77
- rspec-core (2.12.2)
78
- rspec-expectations (2.12.1)
79
- diff-lcs (~> 1.1.3)
80
- rspec-mocks (2.12.1)
81
- rspec-rails (2.12.1)
121
+ thor (>= 0.20.3, < 2.0)
122
+ rake (13.0.1)
123
+ rspec-core (3.8.2)
124
+ rspec-support (~> 3.8.0)
125
+ rspec-expectations (3.8.4)
126
+ diff-lcs (>= 1.2.0, < 2.0)
127
+ rspec-support (~> 3.8.0)
128
+ rspec-mocks (3.8.1)
129
+ diff-lcs (>= 1.2.0, < 2.0)
130
+ rspec-support (~> 3.8.0)
131
+ rspec-rails (3.8.2)
82
132
  actionpack (>= 3.0)
83
133
  activesupport (>= 3.0)
84
134
  railties (>= 3.0)
85
- rspec-core (~> 2.12.0)
86
- rspec-expectations (~> 2.12.0)
87
- rspec-mocks (~> 2.12.0)
88
- sprockets (2.2.2)
89
- hike (~> 1.2)
90
- multi_json (~> 1.0)
91
- rack (~> 1.0)
92
- tilt (~> 1.1, != 1.3.0)
93
- sqlite3 (1.3.7)
94
- thor (0.17.0)
95
- tilt (1.3.6)
96
- treetop (1.4.12)
97
- polyglot
98
- polyglot (>= 0.3.1)
99
- tzinfo (0.3.37)
135
+ rspec-core (~> 3.8.0)
136
+ rspec-expectations (~> 3.8.0)
137
+ rspec-mocks (~> 3.8.0)
138
+ rspec-support (~> 3.8.0)
139
+ rspec-support (3.8.2)
140
+ sprockets (4.0.2)
141
+ concurrent-ruby (~> 1.0)
142
+ rack (> 1, < 3)
143
+ sprockets-rails (3.2.2)
144
+ actionpack (>= 4.0)
145
+ activesupport (>= 4.0)
146
+ sprockets (>= 3.0.0)
147
+ sqlite3 (1.4.1)
148
+ thor (1.0.1)
149
+ thread_safe (0.3.6)
150
+ tzinfo (1.2.7)
151
+ thread_safe (~> 0.1)
152
+ websocket-driver (0.7.3)
153
+ websocket-extensions (>= 0.1.0)
154
+ websocket-extensions (0.1.5)
155
+ zeitwerk (2.3.0)
100
156
 
101
157
  PLATFORMS
102
158
  ruby
103
159
 
104
160
  DEPENDENCIES
105
161
  bootstrap-sass-extras!
162
+ pry
106
163
  rspec-rails
107
164
  sqlite3
165
+
166
+ BUNDLED WITH
167
+ 1.17.2
data/README.md CHANGED
@@ -5,6 +5,12 @@
5
5
  [1]: https://github.com/thomas-mcdonald/bootstrap-sass
6
6
  [2]: https://github.com/seyhunak/twitter-bootstrap-rails
7
7
 
8
+ [![Build Status](https://travis-ci.org/doabit/bootstrap-sass-extras.png?branch=master)](https://travis-ci.org/doabit/bootstrap-sass-extras)
9
+
10
+ ## Note
11
+
12
+ From version 0.0.6, only support bootstrap 3. If you want to use bootstrap 2, please use version 0.0.5.
13
+
8
14
  ## Installation
9
15
 
10
16
  Add this line to your application's Gemfile:
@@ -28,65 +34,86 @@ Generate locale
28
34
 
29
35
  Usage:
30
36
 
31
-
32
- rails g bootstrap:install
33
-
37
+ ```ruby
38
+ rails g bootstrap:install
39
+ ```
34
40
 
35
41
  Layout (generates Twitter Bootstrap compatible layout) - (Haml and Slim supported)
36
42
 
37
43
 
38
44
  Usage:
39
45
 
40
-
41
- rails g bootstrap:layout [LAYOUT_NAME] [*fixed or fluid]
42
-
46
+ ```ruby
47
+ rails g bootstrap:layout [LAYOUT_NAME] [*fixed or fluid]
48
+ ```
43
49
 
44
50
  Example of a fixed layout:
45
51
 
46
-
47
- rails g bootstrap:layout application fixed
48
-
52
+ ```ruby
53
+ rails g bootstrap:layout application fixed
54
+ ```
49
55
 
50
56
  Example of a responsive layout:
51
57
 
52
-
53
- rails g bootstrap:layout application fluid
54
-
58
+ ```ruby
59
+ rails g bootstrap:layout application fluid
60
+ ```
55
61
 
56
62
  Themed (generates Twitter Bootstrap compatible scaffold views.) - (Haml and Slim supported)
57
63
 
58
64
 
59
65
  Usage:
60
66
 
61
-
62
- rails g bootstrap:themed [RESOURCE_NAME]
63
-
67
+ ```ruby
68
+ rails g bootstrap:themed [RESOURCE_NAME]
69
+ ```
64
70
 
65
71
  Example:
66
72
 
67
-
68
- rails g scaffold Post title:string description:text
69
- rake db:migrate
70
- rails g bootstrap:themed Posts
73
+ ```ruby
74
+ rails g scaffold Post title:string description:text
75
+ rake db:migrate
76
+ rails g bootstrap:themed Posts
77
+ ```
71
78
 
72
79
  Notice the plural usage of the resource to generate bootstrap:themed.
73
80
 
74
81
  ## Using Helpers
75
82
 
83
+ ### Viewport Meta Helper
84
+ Add the viewport meta helper `<%= viewport_meta_tag %>` to your layout
85
+ (built-in with layout generator) to render the required meta tag for Bootstrap:
86
+
87
+ ```html
88
+ <meta content="width=device-width,initial-scale=1.0" name="viewport" />
89
+ ```
90
+
91
+ You can change the content value by passing a hash as an argument:
92
+
93
+ ```erb
94
+ <%= viewport_meta_tag(:maximum_scale => "1.0") %>
95
+ ```
96
+
97
+ Renders:
98
+
99
+ ```html
100
+ <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0" name="viewport" />
101
+ ```
102
+
76
103
  ### Flash helper
77
104
  Add flash helper `<%= bootstrap_flash %>` to your layout (built-in with layout generator)
78
105
 
79
106
  ### Modal Helper
80
107
  You can create modals easily using the following example. The header, body, and footer all accept content_tag or plain html.
81
- The href of the button to launch the modal must matche the id of the modal dialog.
82
-
83
- ```ruby
84
- <%= content_tag :a, "Modal", :href => "#modal", :class => 'btn', :data => {:toggle => modal'} %>
108
+ The href of the button to launch the modal must match the id of the modal dialog.
85
109
 
110
+ ```erb
111
+ <%= modal_toggle 'Modal', dialog: '#modal'%>
86
112
  <%= modal_dialog :id => "modal",
87
- :header => { :show_close => true, :dismiss => 'modal', :title => 'Modal header' },
88
- :body => 'This is the body',
89
- :footer => content_tag(:button, 'Save', :class => 'btn') %>
113
+ :header => { :show_close => true, :title => 'Modal header' },
114
+ :body => 'This is the body',
115
+ :footer => content_tag(:button, 'Save', :class => 'btn btn-primary')
116
+ %>
90
117
  ```
91
118
 
92
119
  ### Breadcrumbs Helpers
@@ -94,8 +121,6 @@ The href of the button to launch the modal must matche the id of the modal dialo
94
121
  *Notice* If your application is using [breadcrumbs-on-rails](https://github.com/weppos/breadcrumbs_on_rails) you will have a namespace collision with the add_breadcrumb method.
95
122
  You do not need to use these breadcrumb gems since this gem provides the same functionality out of the box without the additional dependency.
96
123
 
97
- Add breadcrumbs helper `<%= render_breadcrumbs %>` to your layout.
98
-
99
124
  ```ruby
100
125
  class ApplicationController
101
126
  add_breadcrumb :index, :root_path
@@ -112,18 +137,101 @@ class ExamplesController < ApplicationController
112
137
  def show
113
138
  @example = Example.find params[:id]
114
139
  add_breadcrumb @example.name, example_path(@example)
115
- # add_breadcrumb :show, example_path(@example)
140
+ add_breadcrumb :show, example_path(@example)
116
141
  end
117
142
  end
118
143
  ```
119
144
 
120
- ### Glyp Helper
145
+ Finally, add the `<%= render_breadcrumbs %>` helper to your layout.
146
+
147
+ You can wrap the breadcrumbs in an HTML element by using the block form like this:
148
+
149
+ ```erb
150
+ <%= render_breadcrumbs do |breadcrumbs| %>
151
+ <%= content_tag(:div, breadcrumbs, class: "container") %>
152
+ <% end %>
153
+
154
+ # =>
155
+ # <div class="container">
156
+ # <ol class="breadcrumb">
157
+ # <li> ... </li>
158
+ # <li class="active"> ... </li>
159
+ # </ol>
160
+ # </div>
161
+ ```
162
+
163
+ You can also optionally specify which custom view partial you would like to use for rendering the breadcrumbs:
164
+
165
+ ```erb
166
+ <%= render_breadcrumbs partial: 'path/to/custom/breadcrumbs' %>
167
+ ```
168
+
169
+ There are also a few interface methods available for working with the internal breadcrumbs hashes. The following methods are available in controllers and views.
121
170
 
122
171
  ```ruby
123
- glyph(:share_alt)
124
- # => <i class="icon-share-alt"></i>
125
- glyph(:lock, :white)
126
- # => <i class="icon-lock icon-white"></i>
172
+ # Given previously added breadcrumbs:
173
+
174
+ breadcrumbs?
175
+ # => true
176
+
177
+ breadcrumb_names
178
+ # => ["example", "show"]
179
+ ```
180
+
181
+ The following method is available to controllers only.
182
+
183
+ ```ruby
184
+ clear_breadcrumbs
185
+ # => nil
186
+ ```
187
+
188
+ ### Nav Helper
189
+
190
+ To render the Bootstrap example:
191
+
192
+ ```html
193
+ <ul class="nav nav-tabs">
194
+ <li role="presentation" class="active"><a href="/">Home</a></li>
195
+ <li role="presentation"><a href="/profile">Profile</a></li>
196
+ <li role="presentation"><a href="/messages">Messages</a></li>
197
+ </ul>
198
+ ```
199
+
200
+ In your views:
201
+
202
+ ```erb
203
+ <%= nav do %>
204
+ <%= nav_to('Home', root_path) %>
205
+ <%= nav_to(profile_path) do %>
206
+ Profile
207
+ <% end %>
208
+ <%= nav_to('Messages', controller: users, action: :messages) %>
209
+ <%= nav_to('Forced active state', some_path, active: true) %>
210
+ <% end %>
211
+ ```
212
+
213
+ The `tabs` helper declares that a tab component is being used. Alternatively, the `pills` helper can
214
+ be used in the same manner. Other classes can be specified in the `class` hash argument, the `nav`
215
+ class need not be specified.
216
+
217
+ The `nav_to` helper accepts the same methods that the `link_to` helper accepts, but also
218
+ automatically applies the `active` class to the active link.
219
+
220
+ ### Glyph Helper
221
+
222
+ ```erb
223
+ <%= glyph(:star) %>
224
+ # => <span class="glyphicon glyphicon-star"></span>
225
+
226
+ <%= glyph(:star, :paperclip) %>
227
+ # => <span class="glyphicon glyphicon-star"></span><span class="glyphicon glyphicon-paperclip"></span>
228
+ ```
229
+
230
+ ### Badge Helper
231
+
232
+ ```erb
233
+ <%= badge(2) %>
234
+ # => <span class="badge">2</span>
127
235
  ```
128
236
 
129
237
  ## Contributing