twitter-bootstrap-rails 5.3.0 → 5.3.1

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
  SHA256:
3
- metadata.gz: 6164f2f3ab0b1cadb8720be9a9a79a91609e6ef186b01d319a0d4b02672ad080
4
- data.tar.gz: 70f478f98fb8afd96a56eb5ac1e1521eba869c2168f5796be19c9abf36c1a551
3
+ metadata.gz: 91f5452759739c85c9a83fb03127e22cd959aa4f0818a42cd4991fa1b101af9d
4
+ data.tar.gz: 4ffcbb99b350e7733cb7275f67b494df9195229a4a8114e5168850a67bfdf199
5
5
  SHA512:
6
- metadata.gz: 3aa47b2f5834c12aa34cc6553fc9368639d645baf99125d1ea1f727ace28466e6761b3711f5c8570aa8be4d4e1611853d8a3c52276f694a2ec1cc9d0b32703c7
7
- data.tar.gz: 3d1ca08a23b350047ac636708cef5e6ceb6026217b7b9dcdb0137b9c4c074295d59e6b8dbbf6d26dddf1c48f4e5949de9575f441a2cf60f535f14c5d392cba31
6
+ metadata.gz: b10358a115e431626ad9d0ef2b59088db059f8ecb654ea46639fd944363b21ef773bb1e966df5b40f102dea2cd76e59262343a848afcc38a7ad58d36b93d24bc
7
+ data.tar.gz: 56b8e90b7a75b0060acd5d47c08837f719a2161445b7f9445d16995c78224784684d0998e14a18da7af59c0465aa48cba0ec5d27b878fbce9f840d5ae4df5cc0
data/CHANGELOG.md CHANGED
@@ -1,4 +1,6 @@
1
1
  <ul>
2
+ <li>Version 5.3.1 - Documentation and packaging updates only; no library code changes since 5.3.0</li>
3
+ <li>Version 5.3.0 - Bootstrap 5.3 assets, new generators, static asset fixes, requires Ruby >= 3.0, less-rails ~> 4.0</li>
2
4
  <li>Version 5.1.0 - Added Rails 8 compatibility</li>
3
5
  <li>Version 5.0.0 - Current version</li>
4
6
  <li>Version 0.0.5 deprecated</li>
data/README.md CHANGED
@@ -1,700 +1,54 @@
1
1
  # twitter-bootstrap-rails
2
2
 
3
- Bootstrap is a toolkit from Twitter designed to kickstart development of web apps and sites. It includes base CSS and HTML for typography, forms, buttons, tables, grids, navigation, and more.
4
-
5
- twitter-bootstrap-rails project integrates Bootstrap 5 CSS toolkit for Rails Asset Pipeline (Rails 8, Rails 7, Rails 6, Rails 5 and Rails 4.x versions are supported)
6
-
7
3
  [![Gem Version](https://badge.fury.io/rb/twitter-bootstrap-rails.svg)](http://badge.fury.io/rb/twitter-bootstrap-rails)
8
- [![Coverage Status](https://coveralls.io/repos/seyhunak/twitter-bootstrap-rails/badge.svg?branch=master)](https://coveralls.io/repos/seyhunak/twitter-bootstrap-rails/badge.svg?branch=master)
9
4
  [![GitHub stars](https://img.shields.io/github/stars/seyhunak/twitter-bootstrap-rails.svg)](https://github.com/seyhunak/twitter-bootstrap-rails/stargazers)
10
5
  [![GitHub forks](https://img.shields.io/github/forks/seyhunak/twitter-bootstrap-rails.svg)](https://github.com/seyhunak/twitter-bootstrap-rails/network)
11
6
  [![GitHub issues](https://img.shields.io/github/issues/seyhunak/twitter-bootstrap-rails.svg)](https://github.com/seyhunak/twitter-bootstrap-rails/issues)
12
7
 
13
- ## Backers and Sponsors
14
- [![OpenCollective](https://opencollective.com/twitter-bootstrap-rails/backers/badge.svg)](#backers)
15
- [![OpenCollective](https://opencollective.com/twitter-bootstrap-rails/sponsors/badge.svg)](#sponsors)
16
-
17
- ## Screencasts
18
- #### Installing twitter-bootstrap-rails, generators, usage and more
19
-
20
- Screencasts provided by <a href="http://railscasts.com">RailsCasts</a> (Ryan Bates)
21
-
22
- [Twitter Bootstrap Basics](http://railscasts.com/episodes/328-twitter-bootstrap-basics "Twitter Bootstrap Basics")
23
- in this episode you will learn how to include Bootstrap into Rails application with the twitter-bootstrap-rails gem.
24
-
25
- [More on Twitter Bootstrap](http://railscasts.com/episodes/329-more-on-twitter-bootstrap "More on Twitter Bootstrap")
26
- in this episode continues on the Bootstrap project showing how to display flash messages, add form validations with SimpleForm, customise layout with variables, and switch to using Sass.
27
- (Note: This episode is pro episode)
28
-
29
- ## Installing the Gem
30
-
31
- The [Twitter Bootstrap Rails gem](http://rubygems.org/gems/twitter-bootstrap-rails) can provide the Bootstrap stylesheets in two ways.
32
-
33
- The plain CSS way is how Bootstrap is provided on [the official website](http://twbs.github.io/bootstrap/).
34
-
35
- The [Less](http://lesscss.org/) way provides more customisation options, like changing theme colors and provides useful Less mixins for your code, but requires the
36
- Less gem and the Ruby Racer Javascript runtime (not available on Microsoft Windows).
37
-
38
- ### Installing the Less stylesheets
39
-
40
- To use Less stylesheets, you'll need the [less-rails gem](http://rubygems.org/gems/less-rails), and one of [JavaScript runtimes supported by CommonJS](https://github.com/cowboyd/commonjs.rb#supported-runtimes).
41
-
42
- Include these lines in the Gemfile to install the gems from [RubyGems.org](http://rubygems.org):
43
-
44
- ```ruby
45
- gem "therubyracer"
46
- gem "less-rails" #Sprockets (what Rails 3.1 uses for its asset pipeline) supports LESS
47
- gem "twitter-bootstrap-rails"
48
- ```
49
-
50
- or you can install from latest build;
51
-
52
- ```ruby
53
- gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'
54
- ```
55
-
56
- Then run `bundle install` from the command line:
57
-
58
- bundle install
8
+ Integrates Bootstrap 5 into Rails Asset Pipeline. Supports Rails 8, 7, 6, 5.
59
9
 
60
- Then run the bootstrap generator to add Bootstrap includes into your assets:
61
-
62
- rails generate bootstrap:install less
63
-
64
- If you need to skip coffeescript replacement into app generators, use:
65
-
66
- rails generate bootstrap:install --no-coffeescript
67
-
68
- ### Installing the CSS stylesheets (Recommended)
69
-
70
- This is the recommended way to use Bootstrap. It uses pre-compiled static CSS and JavaScript files.
10
+ ## Install
71
11
 
72
12
  ```ruby
13
+ # Gemfile
73
14
  gem "twitter-bootstrap-rails"
74
15
  ```
75
16
 
76
- After running `bundle install`, run the generator:
77
-
78
- rails generate bootstrap:install static
79
-
80
- If your Rails server is running, make sure to restart it.
81
-
82
- ### Installing the Less stylesheets
83
-
84
- To use Less stylesheets for customization, you'll need the [less-rails gem](http://rubygems.org/gems/less-rails), and one of [JavaScript runtimes supported by CommonJS](https://github.com/cowboyd/commonjs.rb#supported-runtimes).
85
-
86
- Include these lines in the Gemfile:
87
-
88
- ```ruby
89
- gem "therubyracer"
90
- gem "less-rails"
91
- gem "twitter-bootstrap-rails"
92
- ```
93
-
94
- Then run:
95
-
96
- bundle install
97
- rails generate bootstrap:install less
98
-
99
- ## Generators
100
-
101
- This gem provides several generators:
102
-
103
- ### bootstrap:install
104
-
105
- Installs Bootstrap assets to your Rails application.
106
-
107
17
  ```bash
108
- rails generate bootstrap:install static # Use pre-compiled CSS (recommended)
109
- rails generate bootstrap:install less # Use Less stylesheets for customization
18
+ bundle install
19
+ rails generate bootstrap:install static
110
20
  ```
111
21
 
112
- Options:
113
- - `--no-coffeescript` - Skip CoffeeScript replacement
114
-
115
- ### bootstrap:layout
116
-
117
- Generates a Bootstrap-compatible layout with navigation navbar.
22
+ ## Generators
118
23
 
119
24
  ```bash
120
- rails generate bootstrap:layout application
121
- ```
122
-
123
- ### bootstrap:themed
25
+ # Install Bootstrap assets
26
+ rails g bootstrap:install static
124
27
 
125
- Generates Bootstrap-themed CRUD views for a resource. Run after creating your scaffold.
28
+ # Generate Bootstrap layout
29
+ rails g bootstrap:layout application
126
30
 
127
- ```bash
128
- rails generate scaffold Post title:string body:text
31
+ # Generate themed views for scaffold
32
+ rails g scaffold Task title:string done:boolean
129
33
  rails db:migrate
130
- rails generate bootstrap:themed Posts
131
- ```
132
-
133
- ### bootstrap:partial
134
-
135
- Generates Bootstrap partials (navbar, navbar-devise, carousel).
136
-
137
- ```bash
138
- rails generate bootstrap:partial navbar
34
+ rails g bootstrap:themed Tasks
139
35
  ```
140
36
 
141
37
  ## Quick Start
142
38
 
143
39
  ```bash
144
- # Create a new Rails app
145
40
  rails new myapp
146
41
  cd myapp
147
-
148
- # Add to Gemfile
149
- gem "twitter-bootstrap-rails"
150
-
151
- # Install dependencies
42
+ echo 'gem "twitter-bootstrap-rails"' >> Gemfile
152
43
  bundle install
153
-
154
- # Install Bootstrap assets
155
44
  rails generate bootstrap:install static
156
-
157
- # Generate a scaffold
158
45
  rails generate scaffold Task title:string description:text completed:boolean
159
-
160
- # Run migrations
161
46
  rails db:migrate
162
-
163
- # Apply Bootstrap theming
164
47
  rails generate bootstrap:themed Tasks
165
-
166
- # Generate layout
167
48
  rails generate bootstrap:layout application
168
-
169
- # Start server
170
49
  rails server
171
50
  ```
172
51
 
173
- Visit http://localhost:3000/tasks to see your Bootstrap-themed app!
174
-
175
-
176
- rails g bootstrap:themed [RESOURCE_NAME]
177
-
178
-
179
- Example:
180
-
181
-
182
- rails g scaffold Post title:string description:text
183
- rake db:migrate
184
- rails g bootstrap:themed Posts
185
-
186
- Notice the plural usage of the resource to generate bootstrap:themed.
187
-
188
- ## Using with Less
189
-
190
- Bootstrap was built with Preboot, an open-source pack of mixins and variables to be used in conjunction with Less, a CSS preprocessor for faster and easier web development.
191
-
192
- ## Using stylesheets with Less
193
-
194
- You have to require Bootstrap LESS (bootstrap_and_overrides.css.less) in your application.css
195
-
196
- ```css
197
- /*
198
- *= require bootstrap_and_overrides
199
- */
200
-
201
- /* Your stylesheets goes here... */
202
- ```
203
-
204
- To use individual components from bootstrap, your bootstrap_and_overrides.less could look like this:
205
-
206
- ```less
207
- // Core variables and mixins
208
- @import "twitter/bootstrap/variables.less";
209
- @import "twitter/bootstrap/mixins.less";
210
-
211
- // Reset and dependencies
212
- @import "twitter/bootstrap/normalize.less";
213
- @import "twitter/bootstrap/print.less";
214
- //@import "twitter/bootstrap/glyphicons.less"; // Excludes glyphicons
215
-
216
- // Core CSS
217
- @import "twitter/bootstrap/scaffolding.less";
218
- @import "twitter/bootstrap/type.less";
219
- @import "twitter/bootstrap/code.less";
220
- @import "twitter/bootstrap/grid.less";
221
- @import "twitter/bootstrap/tables.less";
222
- @import "twitter/bootstrap/forms.less";
223
- @import "twitter/bootstrap/buttons.less";
224
-
225
- // Components
226
- @import "twitter/bootstrap/component-animations.less";
227
- @import "twitter/bootstrap/dropdowns.less";
228
- @import "twitter/bootstrap/button-groups.less";
229
- @import "twitter/bootstrap/input-groups.less";
230
- @import "twitter/bootstrap/navs.less";
231
- @import "twitter/bootstrap/navbar.less";
232
- @import "twitter/bootstrap/breadcrumbs.less";
233
- @import "twitter/bootstrap/pagination.less";
234
- @import "twitter/bootstrap/pager.less";
235
- @import "twitter/bootstrap/labels.less";
236
- @import "twitter/bootstrap/badges.less";
237
- @import "twitter/bootstrap/jumbotron.less";
238
- @import "twitter/bootstrap/thumbnails.less";
239
- @import "twitter/bootstrap/alerts.less";
240
- @import "twitter/bootstrap/progress-bars.less";
241
- @import "twitter/bootstrap/media.less";
242
- @import "twitter/bootstrap/list-group.less";
243
- @import "twitter/bootstrap/panels.less";
244
- @import "twitter/bootstrap/responsive-embed.less";
245
- @import "twitter/bootstrap/wells.less";
246
- @import "twitter/bootstrap/close.less";
247
-
248
- // Components w/ JavaScript
249
- @import "twitter/bootstrap/modals.less";
250
- @import "twitter/bootstrap/tooltip.less";
251
- @import "twitter/bootstrap/popovers.less";
252
- @import "twitter/bootstrap/carousel.less";
253
-
254
- // Utility classes
255
- @import "twitter/bootstrap/utilities.less";
256
- @import "twitter/bootstrap/responsive-utilities.less";
257
- ```
258
-
259
- If you'd like to alter Bootstrap's own variables, or define your LESS
260
- styles inheriting Bootstrap's mixins, you can do so inside bootstrap_and_overrides.css.less:
261
-
262
-
263
- ```less
264
- @link-color: #ff0000;
265
- ```
266
-
267
- ### SASS
268
-
269
- If you are using SASS to compile your application.css (e.g. your manifest file is application.css.sass or application.css.scss) you may get this:
270
-
271
- ```
272
- Invalid CSS after "*": expected "{", was "= require twitt..."
273
- (in app/assets/stylesheets/application.css)
274
- (sass)
275
- ```
276
-
277
- If this is the case, you **must** use @import instead of `*=` in your manifest file, or don't compile your manifest with SASS.
278
-
279
- ### Icons
280
-
281
- By default, this gem (when using less generator) won't enable standard Bootstraps's Glyphicons.
282
-
283
- If you would like to restore the default Glyphicons, inside the generated `bootstrap_and_overrides.css.less` uncomment these lines:
284
-
285
- ```less
286
- // Glyphicons are not required by default, uncomment the following lines to enable them.
287
- @glyphiconsEotPath: font-url("glyphicons-halflings-regular.eot");
288
- @glyphiconsEotPath_iefix: font-url("glyphicons-halflings-regular.eot?#iefix");
289
- @glyphiconsWoffPath: font-url("glyphicons-halflings-regular.woff");
290
- @glyphiconsTtfPath: font-url("glyphicons-halflings-regular.ttf");
291
- @glyphiconsSvgPath: font-url("glyphicons-halflings-regular.svg#glyphicons_halflingsregular");
292
-
293
- @import "twitter/bootstrap/glyphicons.less";
294
- ```
295
-
296
- This gem was used to bundle the excellent [Font-Awesome](http://fortawesome.github.io/Font-Awesome/) library.
297
- However that was another maintenance effort that is not worth to do here.
298
-
299
- For Rails projects that need it there is the [font-awesome-rails gem](https://github.com/bokmann/font-awesome-rails) that
300
- provides same functionality that this gems was used to provide and it also have some other interesting features (e.g. view helpers).
301
-
302
- ## Using JavaScript
303
-
304
- Require Bootstrap JS (bootstrap.js) in your application.js
305
-
306
- ```js
307
- //= require twitter/bootstrap
308
-
309
- $(function(){
310
- /* Your JavaScript goes here... */
311
- });
312
- ```
313
-
314
- If you want to customize what is loaded, your application.js would look something like this
315
-
316
- ```js
317
- #= require jquery
318
- #= require jquery_ujs
319
- #= require twitter/bootstrap/transition
320
- #= require twitter/bootstrap/alert
321
- #= require twitter/bootstrap/modal
322
- #= require twitter/bootstrap/button
323
- #= require twitter/bootstrap/collapse
324
- ```
325
-
326
- ...and so on for each bootstrap js component.
327
-
328
- ## Using CoffeeScript (optionally)
329
-
330
- Using Bootstrap with the CoffeeScript is easy.
331
- twitter-bootstrap-rails generates a "bootstrap.js.coffee" file for you
332
- to /app/assets/javascripts/ folder.
333
-
334
- ```coffee
335
- jQuery ->
336
- $("a[rel~=popover], .has-popover").popover()
337
- $("a[rel~=tooltip], .has-tooltip").tooltip()
338
- ```
339
-
340
- ## Using Helpers
341
-
342
- ### Modal Helper
343
- You can create modals easily using the following example. The header, body, and footer all accept content_tag or plain html.
344
- The href of the button to launch the modal must match the id of the modal dialog. It also accepts a block for the header, body, and footer. If you are getting a complaint about the modal_helper unable to merge a hash it is due to this.
345
-
346
- ```erb
347
- <%= content_tag :a, "Modal", href: "#modal", class: 'btn', data: {toggle: 'modal'} %>
348
- <%= modal_dialog id: "modal",
349
- header: { show_close: true, dismiss: 'modal', title: 'Modal header' },
350
- body: { content: 'This is the body' },
351
- footer: { content: content_tag(:button, 'Save', class: 'btn') } %>
352
- ```
353
-
354
- ### Navbar Helper
355
- It should let you write things like:
356
-
357
- ```erb
358
- <%= nav_bar fixed: :top, brand: "Fashionable Clicheizr 2.0", responsive: true do %>
359
- <%= menu_group do %>
360
- <%= menu_item "Home", root_path %>
361
- <%= menu_divider %>
362
- <%= drop_down "Products" do %>
363
- <%= menu_item "Things you can't afford", expensive_products_path %>
364
- <%= menu_item "Things that won't suit you anyway", harem_pants_path %>
365
- <%= menu_item "Things you're not even cool enough to buy anyway", hipster_products_path %>
366
- <% if current_user.lives_in_hackney? %>
367
- <%= menu_item "Bikes", fixed_wheel_bikes_path %>
368
- <% end %>
369
- <% end %>
370
- <%= menu_item "About Us", about_us_path %>
371
- <%= menu_item "Contact", contact_path %>
372
- <% end %>
373
- <%= menu_group pull: :right do %>
374
- <% if current_user %>
375
- <%= menu_item "Log Out", log_out_path %>
376
- <% else %>
377
- <%= form_for @user, url: session_path(:user), html => {class: "navbar-form pull-right"} do |f| -%>
378
- <p><%= f.text_field :email %></p>
379
- <p><%= f.password_field :password %></p>
380
- <p><%= f.submit "Sign in" %></p>
381
- <% end -%>
382
- <% end %>
383
- <% end %>
384
- <% end %>
385
- ```
386
-
387
- ### Navbar scaffolding
388
-
389
- In your view file (most likely application.html.erb) to get a basic navbar set up you need to do this:
390
-
391
- ```erb
392
- <%= nav_bar %>
393
- ```
394
-
395
- Which will render:
396
-
397
- ```html
398
- <div class="navbar">
399
- <div class="container">
400
- </div>
401
- </div>
402
- ```
403
-
404
- ### Fixed navbar
405
-
406
- If you want the navbar to stick to the top of the screen, pass in the option like this:
407
-
408
- ```erb
409
- <%= nav_bar fixed: :top %>
410
- ```
411
-
412
- To render:
413
-
414
- ```html
415
- <div class="navbar navbar-fixed-top">
416
- <div class="container">
417
- </div>
418
- </div>
419
- ```
420
-
421
- ### Static navbar
422
-
423
- If you want a full-width navbar that scrolls away with the page, pass in the option like this:
424
-
425
- ```erb
426
- <%= nav_bar static: :top %>
427
- ```
428
-
429
- To render:
430
-
431
- ```html
432
- <div class="navbar navbar-static-top">
433
- <div class="container">
434
- </div>
435
- </div>
436
- ```
437
-
438
- ### Brand name
439
-
440
- Add the name of your site on the left hand edge of the navbar. By default, it will link to root_url. Passing a brand_link option will set the url to whatever you want.
441
-
442
- ```erb
443
- <%= nav_bar brand: "We're sooo web 2.0alizr", brand_link: account_dashboard_path %>
444
- ```
445
-
446
- Which will render:
447
-
448
- ```html
449
- <div class="navbar">
450
- <div class="container">
451
- <a class="navbar-brand" href="/accounts/dashboard">
452
- We're sooo web 2.0alizr
453
- </a>
454
- </div>
455
- </div>
456
- ```
457
-
458
- ### Optional responsive variation
459
-
460
- If you want the responsive version of the navbar to work (One that shrinks down on mobile devices etc.), you need to pass this option:
461
-
462
- ```erb
463
- <%= nav_bar responsive: true %>
464
- ```
465
-
466
- Which renders the html quite differently:
467
-
468
- ```html
469
- <div class="navbar">
470
- <div class="container">
471
- <!-- .navbar-toggle is used as the toggle for collapsed navbar content -->
472
- <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
473
- <span class="icon-bar"></span>
474
- <span class="icon-bar"></span>
475
- <span class="icon-bar"></span>
476
- </button>
477
- <!-- Everything in here gets hidden at 940px or less -->
478
- <div class="navbar-collapse collapse">
479
- <!-- menu items gets rendered here instead -->
480
- </div>
481
- </div>
482
- </div>
483
- ```
484
-
485
- ### Nav links
486
-
487
- This is the 'meat' of the code where you define your menu items.
488
-
489
- You can group menu items in theoretical boxes which you can apply logic to - e.g. show different collections for logged in users/logged out users, or simply right align a group.
490
-
491
- The active menu item will be inferred from the link for now.
492
-
493
- The important methods here are menu_group and menu_item.
494
-
495
- menu_group only takes one argument - :pull - this moves the group left or right when passed :left or :right.
496
-
497
- menu_item generates a link wrapped in an li tag. It takes two arguments and an options hash. The first argument is the name (the text that will appear in the menu), and the path (which defaults to "#" if left blank). The rest of the options are passed straight through to the link_to helper, so that you can add classes, ids, methods or data tags etc.
498
-
499
- ```erb
500
- <%= nav_bar fixed: :top, brand: "Ninety Ten" do %>
501
- <%= menu_group do %>
502
- <%= menu_item "Home", root_path %>
503
- <%= menu_item "About Us", about_us_path %>
504
- <%= menu_item "Contact", contact_path %>
505
- <% end %>
506
- <% if current_user %>
507
- <%= menu_item "Log Out", log_out_path %>
508
- <% else %>
509
- <%= menu_group pull: :right do %>
510
- <%= menu_item "Sign Up", registration_path %>
511
- <%= form_for @user, url: session_path(:user) do |f| -%>
512
- <p><%= f.text_field :email %></p>
513
- <p><%= f.password_field :password %></p>
514
- <p><%= f.submit "Sign in" %></p>
515
- <% end -%>
516
- <% end %>
517
- <% end %>
518
- <% end %>
519
- ```
520
-
521
- ### Dropdown menus
522
-
523
- For multi-level list options, where it makes logical sense to group menu items, or simply to save space if you have a lot of pages, you can group menu items into drop down lists like this:
524
-
525
- ```erb
526
- <%= nav_bar do %>
527
- <%= menu_item "Home", root_path %>
528
- <%= drop_down "Products" do %>
529
- <%= menu_item "Latest", latest_products_path %>
530
- <%= menu_item "Top Sellers", popular_products_path %>
531
- <%= drop_down_divider %>
532
- <%= menu_item "Discount Items", discounted_products_path %>
533
- <% end %>
534
- <%= menu_item "About Us", about_us_path %>
535
- <%= menu_item "Contact", contact_path %>
536
- <% end %>
537
- ```
538
-
539
- ### Dividers
540
-
541
- Dividers are just vertical bars that visually separate logically disparate groups of menu items
542
-
543
- ```erb
544
- <%= nav_bar fixed: :bottom do %>
545
- <%= menu_item "Home", root_path %>
546
- <%= menu_item "About Us", about_us_path %>
547
- <%= menu_item "Contact", contact_path %>
548
- <%= menu_divider %>
549
- <%= menu_item "Edit Profile", edit_user_path(current_user) %>
550
- <%= menu_item "Account Settings", edit_user_account_path(current_user, @account) %>
551
- <%= menu_item "Log Out", log_out_path %>
552
- <% end %>
553
- ```
554
-
555
- ### Forms in navbar
556
-
557
- At the moment - this is just a how to...
558
-
559
- You need to add this class to the form itself (Different form builders do this in different ways - please check out the relevant docs)
560
-
561
- ```css
562
- .navbar-form
563
- ```
564
- To pull the form left or right, add either of these classes:
565
- ```css
566
- .pull-left
567
- .pull-right
568
- ```
569
-
570
- If you want the Bootstrap search box (I think it just rounds the corners), use:
571
- ```css
572
- .navbar-search
573
- ```
574
- Instead of:
575
- ```css
576
- .navbar-form
577
- ```
578
-
579
- To change the size of the form fields, use .span2 (or however many span widths you want) to the input itself.
580
-
581
- ### Component alignment
582
-
583
- You can shift things to the left or the right across the nav bar. It's easiest to do this on grouped menu items:
584
-
585
- ```erb
586
- <%= nav_bar fixed: :bottom do %>
587
- <% menu_group do %>
588
- <%= menu_item "Home", root_path %>
589
- <%= menu_item "About Us", about_us_path %>
590
- <%= menu_item "Contact", contact_path %>
591
- <% end %>
592
- <% menu_group pull: :right do %>
593
- <%= menu_item "Edit Profile", edit_user_path(current_user) %>
594
- <%= menu_item "Account Settings", edit_user_account_path(current_user, @account) %>
595
- <%= menu_item "Log Out", log_out_path %>
596
- <% end %>
597
- <% end %>
598
- ```
599
-
600
- ### Text in the navbar
601
-
602
- If you want to put regular plain text in the navbar anywhere, you do it like this:
603
-
604
- ```erb
605
- <%= nav_bar brand: "Apple" do %>
606
- <%= menu_text "We make shiny things" %>
607
- <%= menu_item "Home", root_path %>
608
- <%= menu_item "About Us", about_us_path %>
609
- <% end %>
610
- ```
611
-
612
- It also takes the :pull option to drag it to the left or right.
613
-
614
- ### Flash helper
615
-
616
- Add flash helper `<%= bootstrap_flash %>` to your layout (built-in with layout generator).
617
- You can pass the attributes you want to add to the main div returned: `<%= bootstrap_flash(class: "extra-class", id: "your-id") %>`
618
-
619
-
620
- ### Breadcrumbs Helpers
621
-
622
- *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. For this reason if breadcrumbs-on-rails is detected in `Gemfile` gem methods will be accessible using `boostrap` prefix, i.e. `render_bootstrap_breadcrumbs` and `add_bootstrap_breadcrumb`
623
-
624
- Usually you do not need to use these breadcrumb gems since this gem provides the same functionality out of the box without the additional dependency.
625
-
626
- However if there are some `breadcrumbs-on-rails` features you need to keep you can still use them and use this gem with the prefixes explained above.
627
-
628
- Add breadcrumbs helper `<%= render_breadcrumbs %>` to your layout.
629
- You can also specify a divider for it like this: `<%= render_breadcrumbs('>') %>` (default divider is `/`).
630
- If you do not need dividers at all you can use `nil`: `<%= render_breadcrumbs(nil) %>`.
631
-
632
- Full example:
633
- ```ruby
634
-
635
- render_breadcrumbs(" / ", { class: '', item_class: '', divider_class: '', active_class: 'active' })
636
-
637
- ```
638
-
639
- ```ruby
640
- class ApplicationController
641
- add_breadcrumb :root # 'root_path' will be used as url
642
- end
643
- ```
644
-
645
- ```ruby
646
- class ExamplesController < ApplicationController
647
- add_breadcrumb :index, :examples_path
648
-
649
- def edit
650
- @example = Example.find params[:id]
651
- add_breadcrumb @example # @example.to_s as name, example_path(@example) as url
652
- add_breadcrumb :edit, edit_example_path(@example)
653
- end
654
- end
655
- ```
656
- All symbolic names translated with I18n. See [I18n Internationalization Support](#i18n-internationalization-support)
657
- section.
658
-
659
- ### Element utility helpers
660
-
661
- Badge:
662
- ```erb
663
- <%= badge(12, :warning) %> <span class="badge badge-warning">12</span>
664
- ```
665
-
666
- Label:
667
- ```erb
668
- <%= tag_label('Good!', :success) %> <span class="label label-success">Good!</span>
669
- ```
670
-
671
- Glyph:
672
- ```erb
673
- <%= glyph(:pencil) %> <i class="icon-pencil"></i>
674
- <%= glyph(:pencil, {tag: :span}) %> <span class="icon-pencil"></span>
675
- <%= glyph(:pencil, {class: 'foo'}) %> <i class="icon-pencil foo"></i>
676
- ```
677
-
678
- ### I18n Internationalization Support
679
- The installer creates an English translation file for you and copies it to config/locales/en.bootstrap.yml
680
-
681
- NOTE: If you are using Devise in your project, you must have a devise locale file
682
- for handling flash messages, even if those messages are blank. See https://github.com/plataformatec/devise/wiki/I18n
683
-
684
- ## Changelog
685
- Please see CHANGELOG.md for more details
686
-
687
- ## Contributors & Patches & Forks
688
- Please see CONTRIBUTERS.md for contributors list
689
-
690
- ## Thanks
691
- Bootstrap and all twitter-bootstrap-rails contributors
692
- http://twbs.github.io/bootstrap
693
-
694
52
  ## License
695
- Copyright (c) 2026 (since 2012) by Seyhun Akyürek
696
-
697
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
698
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
699
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
700
53
 
54
+ MIT
@@ -1,7 +1,7 @@
1
1
  module Twitter
2
2
  module Bootstrap
3
3
  module Rails
4
- VERSION = "5.3.0"
4
+ VERSION = "5.3.1"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twitter-bootstrap-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.3.0
4
+ version: 5.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seyhun Akyurek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-02-18 00:00:00.000000000 Z
11
+ date: 2026-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties