Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bootstrap-grid-system

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bootstrap-grid-system

  • 0.2.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Bootstrap Grid System

The Bootstrap Grid System gem is a small and very simple tag generator for Bootstrap gem.

Dependencies

Ruby 1.9+

Rails 4.0+

Twitter Bootstrap 3.0+

Installation

Add the gem to your Gemfile

gem 'bootstrap-grid-system'

Bundle install

$ bundle install

Examples

Bootstrap row

Use bootstrap_row to wrap the content in a div block with "row" class

<%= bootstrap_row { "Example" } %>

This generates the following HTML:

<div class="row">Example</div>

To disable bootstrap row, use the :row_disabled option

<%= bootstrap_row(row_disabled: true) { "Example" } %>

This generates the following HTML:

Example

Bootstrap col

Use bootstrap_col to wrap the content in a div block with "col-md-12" class

<%= bootstrap_col { "Example" } %>

This generates the following HTML:

<div class="col-md-12">Example</div>

To change the default number of columns, use the :col or :offset_col options

<%= bootstrap_col(col: 2, offset_col: 4) { "Example" } %>

This generates the following HTML:

<div class="col-md-2 col-md-offset-4">Example</div>

To change the default grid class, use the :grid_system option

<%= bootstrap_col(grid_system: :lg) { "Example" } %>

This generates the following HTML:

<div class="col-lg-12">Example</div>

To disable bootstrap column div, use the :col_disabled option

<%= bootstrap_col(col_disabled: true) { "Example" } %>

This generates the following HTML:

Example

Bootstrap row with col

Use bootstrap_row_with_col to wrap the content in a div block with "row" class and div with class "col-md-12" inside

<%= bootstrap_row_with_col { "Example" } %>

This generates the following HTML:

<div class="row">
	<div class="col-md-12">Example</div>
</div>

To change the default number of columns, use the :col or :offset_col options

<%= bootstrap_row_with_col(col: 2, offset_col: 4) { "Example" } %>

This generates the following HTML:

<div class="row">
	<div class="col-md-2 col-md-offset-4">Example</div>
</div>

To change the default grid class, use the :grid_system option

<%= bootstrap_row_with_col(grid_system: :lg) { "Example" } %>

This generates the following HTML:

<div class="row">
	<div class="col-lg-12">Example</div>
</div>

To disable bootstrap row, use the :row_disabled option

<%= bootstrap_row_with_col(row_disabled: true) { "Example" } %>

This generates the following HTML:

<div class="col-md-12">Example</div>

To disable bootstrap column div, use the :col_disabled option

<%= bootstrap_row_with_col(col_disabled: true) { "Example" } %>

This generates the following HTML:

<div class="row">Example</div>

Standard html options

Use :id, :class or other html options to add your value

<%= bootstrap_row_with_col(id: "foo", class: "bar") { "Example" } %>

This generates the following HTML:

<div class="row bar" id="foo">
	<div class="col-md-12">Example</div>
</div>

License

This project rocks and uses MIT-LICENSE.

FAQs

Package last updated on 22 Dec 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc