Skip to content
/ rails_starter Public template

Rails starter app with devise, omniauth, rspec, roles, pundit, haml, bootstrap, jquery, guard, spring, API

Notifications You must be signed in to change notification settings

MohamedBrary/rails_starter

Repository files navigation

Creating Rails Project

Initialization

# List available rubies, to choose which ruby to use
$ rvm list rubies

# To install new ruby use, for example version '2.4.1'
$ rvm install 2.4.1

# create and use the new RVM gemset for project "my_app"
$ rvm use --create 2.4.1@my_app

# install latest rails into the blank gemset
$ gem install rails

# Creates new rails app "my_app"
# -d mysql: defining database
# -T to skip generating test folder and files (in case of planning to use rspec)
$ rails new my_app -d mysql -T

# go into the new project directory and create a .ruby-version and .ruby-gemset for the project
$ cd my_app
$ rvm --ruby-version use 2.4.1@my_app

# initialize git
$ git init
$ git add .
$ git commit -m 'new rails app'
$ git remote add origin git@git.x.com:x/my_app.git
$ git push -u origin master

Gems

Haml and Bootstrap

gem 'haml-rails'
gem 'bootstrap-generators' # to generate views using bootstrap
$ rake haml:erb2haml
$ rails generate bootstrap:install --template-engine=haml

Devise and OmniAuth

gem 'devise', '~> 3.4'
gem 'omniauth'
gem 'omniauth-twitter'
gem 'omniauth-facebook'
gem 'omniauth-instagram'
gem 'twitter'
gem 'instagram'
gem 'omniauth-google-oauth2'
gem 'google-api-client', require: 'google/api_client'
gem 'devise-bootstrap-views' # to generate bootstrap devise views
$ rails g devise:views:bootstrap_haml_templates
$ rails g scaffold User name role:integer
$ rails generate devise User

# Edit database.yml to match your configuration
$ rake db:create db:migrate

Others

  • For devise and other authentication options checkout this See link.
  • To setup testing checkout this See link.