Coder Social home page Coder Social logo

asecondwill / bootstrap_views_generator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tarellel/bootstrap_views_generator

0.0 0.0 0.0 105 KB

A Rails generator for creating bootstrap styled views (Erb, Slim, and HAML).

License: MIT License

Shell 0.55% Ruby 51.67% HTML 18.17% Haml 14.86% Slim 14.75%

bootstrap_views_generator's Introduction

BootstrapViewsGenerator

MIT license Gem

This gem is used for generating Bootstrap based scaffold views for your Rails application. They can be Erb, Slim, or HAML. You can include pagination (using Pagy), simple_form (for the form components), and if you'd like you can utilize the meta-tags gems to all dynamic page titles when switching between your view components.

Installation

Add this line to your application's Gemfile:

gem 'bootstrap_views_generator', group: :development

# Now make sure you have the bootstrap gem installed in your Gemfile
gem 'bootstrap', '~> 4.3'

# And ensure you have bootstrap included in your application.scss
@import 'bootstrap';

And then execute:

$ bundle

Or install it yourself as:

$ gem install bootstrap_views_generator

Usage

Usage:
  rails g bootstrap:install [options]

Options:
Options:
-t, [--template-engine=TEMPLATE_ENGINE]     # Indicates when to generate using a designated template engine (erb, slim, haml)
                                            # Default: erb
--simpleform                                # Indicates if simple_form is to be used to generate the forms
                                            # Default: false
--pagination                                # Specify if you want to add pagination to the index pages
                                            # Defaults: false (requires Pagy to use pagination)
--metatags                                  # If you want the pages titles to use the metatags gem function for the page title
                                            # Default: false
--layout                                    # Over-write your application layout file with a bootstrap based layout
                                            # Default: false
--devise                                    # If you want to generate bootstrap based devise views
                                            # Default: false
--skip_javascript                           # If you want to skip adding javascript_include_tag || javascript_pack_tag to the layouts
                                            # Default: false
--skip_turbolinks                           # Do you want to skip associating turbolinks with the assets and views
                                            # Default: false

Options

Template Engines

Supported Template Engines

  • ERB
  • HAML
  • Slim

HAML

Make sure you have haml added to your your Gemfile

gem 'haml-rails'

# generate haml views
rails g bootstrap:install --template_engine=haml

Slim Make sure you have Slim added to your Gemfile

gem 'slim-rails'

# generate Slim views
rails g bootstrap:install --template_engine=slim

Pagination

Ensure you have Pagy gem installed

# Gemfile
gem 'pagy'

# Make sure you have the bootstrap pagy helper included
# config/initializers/pagy.rb
require 'pagy/extras/bootstrap'

Meta-Tags

Ensure you have the meta-tags gem installed

gem 'meta-tags'

Examples

Generate bootstrap views with pagination and search enabled

rails g bootstrap:install --pagination --ransack

Generate bootstrap views with slim and using simple_form

rails g bootstrap:install --template_engine=slim --simpleform

Generate bootstrap scaffolds, devise views, while using simpleform, metatags, and slim template engine.

 rails g bootstrap:install --devise --simpleform --metatags --template_engine=slim

Extras

  • If you like to use the meta-tags gem to add page titles based on the views.
  • Pagination defaults to using Pagy on the index pages.
  • With simple_form it is assumed your have already run the simple_form generator for displaying bootstrap based components.
    rails generate simple_form:install --bootstrap

bootstrap_views_generator's People

Contributors

tarellel avatar

bootstrap_views_generator's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.