Skip to content

pedrogrande/rails501template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rails 5 App Template

This is a general purpose Rails 5.0.1 app template that is setup to use postgresql. It includes authentication, authorization and bootstrap styling.

To use

  1. Fork and/or clone this repo from github. git clone git@github.com:pedrogrande/rails501template.git. Apply your own project name by adding the app's name after this command.
  2. Enter the created folder: cd rails501template. Or the name you gave your project.
  3. If you don't have Postgresql installed locally, you may wish to swap the database to sqlite3. Change this in the Gemfile. This will also require you to update config/database.yml to reflect the sqlite3.
  4. Run a bundle. bundle
  5. Edit the database names in config/database.yml (only if using Postgresql)
  6. Create the databases: rails db:create
  7. Run the migrations: rails db:migrate
  8. Optionally, seed the database with a default admin user: rails db:seed

Included Gems

Customizations

Devise

A user model is added with default Devise settings. A devise layout has been created in app/views/layouts that puts the devise views in a centered bootstrap panel.

Simple_form

Simple_form is installed with the --bootstrap flag.

Browser validations config setting has been set to true in config/initializers/simple_form.rb:120

config.browser_validations = true

Cancancan

The ability model file has been edited to use Rolify has_role? method.

app/models/ability.rb

Bootstrap

Version 4 of Bootstrap is installed through the bootstrap-sass gem. A navbar partial is located in app/views/shared. A fading alerts partial is located in app/views/shared.

Navbar

The navbar has Rails code to show a Sign in link when the user is not signed in. When the user is signed in, they will see a Dropdown menu and Sign out link.

About

Rails 5.0.1 App template with Devise, Cancan, Rolify, Bootstrap 4

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published