├── .gitignore ├── .rspec ├── .travis.yml ├── Gemfile ├── Gemfile.lock ├── Procfile ├── README.md ├── Rakefile ├── app ├── assets │ ├── images │ │ └── .keep │ ├── javascripts │ │ └── application.coffee │ └── stylesheets │ │ └── application.scss ├── controllers │ ├── application_controller.rb │ ├── concerns │ │ └── .keep │ └── errors_controller.rb ├── helpers │ └── application_helper.rb ├── mailers │ └── .keep ├── models │ ├── .keep │ └── concerns │ │ └── .keep └── views │ ├── errors │ ├── 500.slim │ └── show.slim │ └── layouts │ ├── application.slim │ └── error.slim ├── bin ├── bundle ├── rails ├── rake └── rspec ├── config.ru ├── config ├── application.rb ├── application.yml ├── boot.rb ├── database.yml ├── environment.rb ├── environments │ ├── development.rb │ ├── production.rb │ └── test.rb ├── initializers │ ├── backtrace_silencers.rb │ ├── filter_parameter_logging.rb │ ├── inflections.rb │ ├── mime_types.rb │ ├── secret_token.rb │ ├── session_store.rb │ └── wrap_parameters.rb ├── locales │ └── en.yml ├── routes.rb └── sidekiq.yml ├── db ├── schema.rb └── seeds.rb ├── lib ├── assets │ └── .keep └── tasks │ └── .keep ├── public ├── favicon.ico └── robots.txt ├── spec ├── application │ └── security_spec.rb ├── controllers │ └── .keep ├── fixtures │ └── .keep ├── helpers │ └── .keep ├── integration │ └── .keep ├── mailers │ └── .keep ├── models │ └── .keep └── spec_helper.rb └── vendor └── assets ├── javascripts └── .keep └── stylesheets └── .keep /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile '~/.gitignore_global' 6 | 7 | # Ignore bundler config. 8 | /.bundle 9 | 10 | # Ignore the default SQLite database. 11 | /db/*.sqlite3 12 | /db/*.sqlite3-journal 13 | 14 | # Ignore all logfiles and tempfiles. 15 | /log/*.log 16 | /tmp 17 | 18 | /config/database.yml 19 | 20 | # Ignore local application configuration 21 | /.env* 22 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --color 2 | --format progress 3 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: ruby 2 | rvm: 3 | - 2.1.0 4 | script: 5 | - RAILS_ENV=test bundle exec rake db:create db:migrate --trace 6 | - bundle exec rspec 7 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | source 'https://rails-assets.org' 3 | 4 | # Core 5 | gem 'rails', '~> 4.1.4' 6 | gem 'pg', '~> 0.17.1' 7 | 8 | # Backend 9 | gem 'dotenv-rails', '~> 1.0.2' 10 | gem 'yajl-ruby', '~> 1.2.0', :require => 'yajl/json_gem' 11 | 12 | # Frontend 13 | gem 'coffee-rails', '~> 4.1.0' 14 | gem 'sass-rails', '~> 4.0.0' 15 | gem 'uglifier', '~> 2.4' 16 | gem 'slim-rails', '~> 2.0' 17 | gem 'quiet_assets', '~> 1.0' 18 | 19 | # Background jobs 20 | gem 'sidekiq', '~> 3.2.5' 21 | gem 'sidekiq-failures', '~> 0.4.3' 22 | gem 'sinatra', '>= 1.3.0', :require => nil 23 | 24 | group :development do 25 | gem 'awesome_print' 26 | gem 'better_errors', :platform => :ruby 27 | gem 'binding_of_caller', :platform => :ruby 28 | 29 | gem 'pry' 30 | gem 'pry-doc' 31 | gem 'pry-byebug' 32 | end 33 | 34 | group :test do 35 | gem 'rspec-rails', '~> 3.0' 36 | gem 'database_cleaner', '~> 1.2' 37 | end 38 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | remote: https://rails-assets.org/ 4 | specs: 5 | actionmailer (4.1.6) 6 | actionpack (= 4.1.6) 7 | actionview (= 4.1.6) 8 | mail (~> 2.5, >= 2.5.4) 9 | actionpack (4.1.6) 10 | actionview (= 4.1.6) 11 | activesupport (= 4.1.6) 12 | rack (~> 1.5.2) 13 | rack-test (~> 0.6.2) 14 | actionview (4.1.6) 15 | activesupport (= 4.1.6) 16 | builder (~> 3.1) 17 | erubis (~> 2.7.0) 18 | activemodel (4.1.6) 19 | activesupport (= 4.1.6) 20 | builder (~> 3.1) 21 | activerecord (4.1.6) 22 | activemodel (= 4.1.6) 23 | activesupport (= 4.1.6) 24 | arel (~> 5.0.0) 25 | activesupport (4.1.6) 26 | i18n (~> 0.6, >= 0.6.9) 27 | json (~> 1.7, >= 1.7.7) 28 | minitest (~> 5.1) 29 | thread_safe (~> 0.1) 30 | tzinfo (~> 1.1) 31 | arel (5.0.1.20140414130214) 32 | awesome_print (1.2.0) 33 | better_errors (2.0.0) 34 | coderay (>= 1.0.0) 35 | erubis (>= 2.6.6) 36 | rack (>= 0.9.0) 37 | binding_of_caller (0.7.2) 38 | debug_inspector (>= 0.0.1) 39 | builder (3.2.2) 40 | byebug (3.5.1) 41 | columnize (~> 0.8) 42 | debugger-linecache (~> 1.2) 43 | slop (~> 3.6) 44 | celluloid (0.15.2) 45 | timers (~> 1.1.0) 46 | coderay (1.1.0) 47 | coffee-rails (4.1.0) 48 | coffee-script (>= 2.2.0) 49 | railties (>= 4.0.0, < 5.0) 50 | coffee-script (2.3.0) 51 | coffee-script-source 52 | execjs 53 | coffee-script-source (1.8.0) 54 | columnize (0.8.9) 55 | connection_pool (2.0.0) 56 | database_cleaner (1.3.0) 57 | debug_inspector (0.0.2) 58 | debugger-linecache (1.2.0) 59 | diff-lcs (1.2.5) 60 | dotenv (1.0.2) 61 | dotenv-rails (1.0.2) 62 | dotenv (= 1.0.2) 63 | erubis (2.7.0) 64 | execjs (2.2.2) 65 | hike (1.2.3) 66 | i18n (0.6.11) 67 | json (1.8.1) 68 | mail (2.6.1) 69 | mime-types (>= 1.16, < 3) 70 | method_source (0.8.2) 71 | mime-types (2.4.2) 72 | minitest (5.4.2) 73 | multi_json (1.10.1) 74 | pg (0.17.1) 75 | pry (0.10.1) 76 | coderay (~> 1.1.0) 77 | method_source (~> 0.8.1) 78 | slop (~> 3.4) 79 | pry-byebug (2.0.0) 80 | byebug (~> 3.4) 81 | pry (~> 0.10) 82 | pry-doc (0.6.0) 83 | pry (~> 0.9) 84 | yard (~> 0.8) 85 | quiet_assets (1.0.3) 86 | railties (>= 3.1, < 5.0) 87 | rack (1.5.2) 88 | rack-protection (1.5.3) 89 | rack 90 | rack-test (0.6.2) 91 | rack (>= 1.0) 92 | rails (4.1.6) 93 | actionmailer (= 4.1.6) 94 | actionpack (= 4.1.6) 95 | actionview (= 4.1.6) 96 | activemodel (= 4.1.6) 97 | activerecord (= 4.1.6) 98 | activesupport (= 4.1.6) 99 | bundler (>= 1.3.0, < 2.0) 100 | railties (= 4.1.6) 101 | sprockets-rails (~> 2.0) 102 | railties (4.1.6) 103 | actionpack (= 4.1.6) 104 | activesupport (= 4.1.6) 105 | rake (>= 0.8.7) 106 | thor (>= 0.18.1, < 2.0) 107 | rake (10.3.2) 108 | redis (3.1.0) 109 | redis-namespace (1.5.1) 110 | redis (~> 3.0, >= 3.0.4) 111 | rspec-core (3.1.7) 112 | rspec-support (~> 3.1.0) 113 | rspec-expectations (3.1.2) 114 | diff-lcs (>= 1.2.0, < 2.0) 115 | rspec-support (~> 3.1.0) 116 | rspec-mocks (3.1.3) 117 | rspec-support (~> 3.1.0) 118 | rspec-rails (3.1.0) 119 | actionpack (>= 3.0) 120 | activesupport (>= 3.0) 121 | railties (>= 3.0) 122 | rspec-core (~> 3.1.0) 123 | rspec-expectations (~> 3.1.0) 124 | rspec-mocks (~> 3.1.0) 125 | rspec-support (~> 3.1.0) 126 | rspec-support (3.1.2) 127 | sass (3.2.19) 128 | sass-rails (4.0.3) 129 | railties (>= 4.0.0, < 5.0) 130 | sass (~> 3.2.0) 131 | sprockets (~> 2.8, <= 2.11.0) 132 | sprockets-rails (~> 2.0) 133 | sidekiq (3.2.5) 134 | celluloid (= 0.15.2) 135 | connection_pool (>= 2.0.0) 136 | json 137 | redis (>= 3.0.6) 138 | redis-namespace (>= 1.3.1) 139 | sidekiq-failures (0.4.3) 140 | sidekiq (>= 2.16.0) 141 | sinatra (1.4.5) 142 | rack (~> 1.4) 143 | rack-protection (~> 1.4) 144 | tilt (~> 1.3, >= 1.3.4) 145 | slim (2.1.0) 146 | temple (~> 0.6.9) 147 | tilt (>= 1.3.3, < 2.1) 148 | slim-rails (2.1.5) 149 | actionpack (>= 3.0, < 4.2) 150 | activesupport (>= 3.0, < 4.2) 151 | railties (>= 3.0, < 4.2) 152 | slim (~> 2.0) 153 | slop (3.6.0) 154 | sprockets (2.10.1) 155 | hike (~> 1.2) 156 | multi_json (~> 1.0) 157 | rack (~> 1.0) 158 | tilt (~> 1.1, != 1.3.0) 159 | sprockets-rails (2.2.0) 160 | actionpack (>= 3.0) 161 | activesupport (>= 3.0) 162 | sprockets (>= 2.8, < 4.0) 163 | temple (0.6.9) 164 | thor (0.19.1) 165 | thread_safe (0.3.4) 166 | tilt (1.4.1) 167 | timers (1.1.0) 168 | tzinfo (1.2.2) 169 | thread_safe (~> 0.1) 170 | uglifier (2.5.3) 171 | execjs (>= 0.3.0) 172 | json (>= 1.8.0) 173 | yajl-ruby (1.2.1) 174 | yard (0.8.7.4) 175 | 176 | PLATFORMS 177 | ruby 178 | 179 | DEPENDENCIES 180 | awesome_print 181 | better_errors 182 | binding_of_caller 183 | coffee-rails (~> 4.1.0) 184 | database_cleaner (~> 1.2) 185 | dotenv-rails (~> 1.0.2) 186 | pg (~> 0.17.1) 187 | pry 188 | pry-byebug 189 | pry-doc 190 | quiet_assets (~> 1.0) 191 | rails (~> 4.1.4) 192 | rspec-rails (~> 3.0) 193 | sass-rails (~> 4.0.0) 194 | sidekiq (~> 3.2.5) 195 | sidekiq-failures (~> 0.4.3) 196 | sinatra (>= 1.3.0) 197 | slim-rails (~> 2.0) 198 | uglifier (~> 2.4) 199 | yajl-ruby (~> 1.2.0) 200 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: bin/rails s --port 3000 2 | sidekiq: bin/sidekiq --config config/sidekiq.yml 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Rails 4 Bootstrap [![Dependency Status][gemnasium-img-url]][gemnasium-url] [![Code Climate][codeclimate-img-url]][codeclimate-url] [![Build Status][travis-img-url]][travis-url] 2 | 3 | [codeclimate-img-url]: https://codeclimate.com/github/sheerun/rails4-bootstrap.png 4 | [codeclimate-url]: https://codeclimate.com/github/sheerun/rails4-bootstrap 5 | [gemnasium-img-url]: https://gemnasium.com/sheerun/rails4-bootstrap.png 6 | [gemnasium-url]: https://gemnasium.com/sheerun/rails4-bootstrap 7 | [travis-img-url]: https://travis-ci.org/sheerun/rails4-bootstrap.png 8 | [travis-url]: https://travis-ci-org/sheerun/rails4-bootstrap 9 | 10 | My systematic way of making bullet-proof Rails 4 bootstrap template. 11 | 12 | Every commit is assigned to Github issue. Each alternative being evaluated. 13 | 14 | Essential things in the master branch, optional features in branches, ready for fast-forward merging. 15 | 16 | ## Requirements: 17 | 18 | 1. Ruby >= 2.0 19 | 2. Node.js installed (for assets precompilation) 20 | 21 | ## License 22 | 23 | As Rails, this project is [MIT-licensed](http://opensource.org/licenses/mit-license.php). As usual, you are awesome. 24 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require File.expand_path('../config/application', __FILE__) 5 | 6 | Application.load_tasks 7 | -------------------------------------------------------------------------------- /app/assets/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sheerun/rails4-bootstrap/68140014f3f63b9b1164cccc96aa024d92f83465/app/assets/images/.keep -------------------------------------------------------------------------------- /app/assets/javascripts/application.coffee: -------------------------------------------------------------------------------- 1 | #= require_tree . 2 | #= require_self 3 | -------------------------------------------------------------------------------- /app/assets/stylesheets/application.scss: -------------------------------------------------------------------------------- 1 | //= require_tree . 2 | //= require_self 3 | -------------------------------------------------------------------------------- /app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | # Prevent CSRF attacks by raising an exception. 3 | # For APIs, you may want to use :null_session instead. 4 | protect_from_forgery with: :exception 5 | end 6 | -------------------------------------------------------------------------------- /app/controllers/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sheerun/rails4-bootstrap/68140014f3f63b9b1164cccc96aa024d92f83465/app/controllers/concerns/.keep -------------------------------------------------------------------------------- /app/controllers/errors_controller.rb: -------------------------------------------------------------------------------- 1 | class ErrorsController < ActionController::Base 2 | 3 | # Because we don't inherit from ApplicationController 4 | layout 'error' 5 | 6 | # You can use these method in views 7 | helper_method :status_code, :status_name, :error_message 8 | 9 | # You can edit format.json for proper API response format. 10 | def show 11 | custom_template = template_exists?(status_code, 'errors') 12 | 13 | respond_to do |format| 14 | format.html { render action: custom_template ? status_code.to_s : 'show' } 15 | format.json { render json: { status: status_code, message: error_message } } 16 | end 17 | end 18 | 19 | protected 20 | 21 | def status_code 22 | (request.path.match(/\d{3}/) || ['500'])[0].to_i 23 | end 24 | 25 | def status_name 26 | Rack::Utils::HTTP_STATUS_CODES.fetch(status_code, "Internal Server Error") 27 | end 28 | 29 | def error_message 30 | if status_code != 500 && exception 31 | exception.message 32 | else 33 | "Our administrator has been notified about this event." 34 | end 35 | end 36 | 37 | def exception 38 | env['action_dispatch.exception'] 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sheerun/rails4-bootstrap/68140014f3f63b9b1164cccc96aa024d92f83465/app/mailers/.keep -------------------------------------------------------------------------------- /app/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sheerun/rails4-bootstrap/68140014f3f63b9b1164cccc96aa024d92f83465/app/models/.keep -------------------------------------------------------------------------------- /app/models/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sheerun/rails4-bootstrap/68140014f3f63b9b1164cccc96aa024d92f83465/app/models/concerns/.keep -------------------------------------------------------------------------------- /app/views/errors/500.slim: -------------------------------------------------------------------------------- 1 | / An example of custom error page. 2 | .dialog 3 | h1 We're sorry, but something went wrong. 4 | p If you are the application owner check the logs for more information. 5 | -------------------------------------------------------------------------------- /app/views/errors/show.slim: -------------------------------------------------------------------------------- 1 | / Generic template for errors 2 | .dialog 3 | h1 4 | = Rack::Utils::HTTP_STATUS_CODES[status_code] || "Internal Server Error" 5 | = " (#{status_code})" 6 | p= error_message 7 | -------------------------------------------------------------------------------- /app/views/layouts/application.slim: -------------------------------------------------------------------------------- 1 | doctype 2 | html 3 | head 4 | title Rails4Bootstrap 5 | = stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true 6 | = javascript_include_tag "application", "data-turbolinks-track" => true 7 | = csrf_meta_tags 8 | body 9 | = yield 10 | -------------------------------------------------------------------------------- /app/views/layouts/error.slim: -------------------------------------------------------------------------------- 1 | doctype 2 | html 3 | head 4 | title We're sorry, but something went wrong (500) 5 | css: 6 | body { 7 | background-color: #EFEFEF; 8 | color: #2E2F30; 9 | text-align: center; 10 | font-family: arial, sans-serif; 11 | } 12 | 13 | div.dialog { 14 | width: 25em; 15 | margin: 4em auto 0 auto; 16 | border: 1px solid #CCC; 17 | border-right-color: #999; 18 | border-left-color: #999; 19 | border-bottom-color: #BBB; 20 | border-top: #B00100 solid 4px; 21 | border-top-left-radius: 9px; 22 | border-top-right-radius: 9px; 23 | background-color: white; 24 | padding: 7px 4em 0 4em; 25 | } 26 | 27 | h1 { 28 | font-size: 100%; 29 | color: #730E15; 30 | line-height: 1.5em; 31 | } 32 | 33 | body > p { 34 | width: 31em; 35 | margin: 0 auto 1em; 36 | padding: 1em; 37 | background-color: #F7F7F7; 38 | border: 1px solid #CCC; 39 | border-right-color: #999; 40 | border-bottom-color: #999; 41 | border-bottom-left-radius: 4px; 42 | border-bottom-right-radius: 4px; 43 | border-top-color: #DADADA; 44 | color: #666; 45 | box-shadow:0 3px 8px rgba(50, 50, 50, 0.17); 46 | } 47 | body 48 | = yield 49 | -------------------------------------------------------------------------------- /bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_PATH = File.expand_path('../../config/application', __FILE__) 3 | require_relative '../config/boot' 4 | require 'rails/commands' 5 | -------------------------------------------------------------------------------- /bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative '../config/boot' 3 | require 'rake' 4 | Rake.application.run 5 | -------------------------------------------------------------------------------- /bin/rspec: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # 3 | # This file was generated by Bundler. 4 | # 5 | # The application 'rspec' is installed as part of a gem, and 6 | # this file is here to facilitate running it. 7 | # 8 | 9 | require 'pathname' 10 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", 11 | Pathname.new(__FILE__).realpath) 12 | 13 | require 'rubygems' 14 | require 'bundler/setup' 15 | 16 | load Gem.bin_path('rspec-core', 'rspec') 17 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require ::File.expand_path('../config/environment', __FILE__) 4 | run Rails.application 5 | -------------------------------------------------------------------------------- /config/application.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../boot', __FILE__) 2 | 3 | require 'rails/all' 4 | 5 | Bundler.require(:default, Rails.env) 6 | 7 | class Application < Rails::Application 8 | config.generators do |g| 9 | g.test_framework :rspec, fixture: false 10 | g.view_specs false 11 | g.integration_specs false 12 | g.stylesheets = false 13 | g.javascripts = false 14 | g.helper = false 15 | end 16 | 17 | config.exceptions_app = self.routes 18 | end 19 | -------------------------------------------------------------------------------- /config/application.yml: -------------------------------------------------------------------------------- 1 | # Permanenent configuraton here. For local config use .env file. 2 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | # Set up gems listed in the Gemfile. 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | 4 | require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) 5 | -------------------------------------------------------------------------------- /config/database.yml: -------------------------------------------------------------------------------- 1 | # PostgreSQL. Versions 8.2 and up are supported. 2 | # 3 | # Install the pg driver: 4 | # gem install pg 5 | # On OS X with Homebrew: 6 | # gem install pg -- --with-pg-config=/usr/local/bin/pg_config 7 | # 8 | 9 | default: &default 10 | adapter: postgresql 11 | encoding: unicode 12 | pool: 5 13 | # min_messages: warning 14 | # debug5, debug4, debug3, debug2, debug1, 15 | # log, notice, warning, error, fatal, and panic 16 | 17 | development: 18 | <<: *default 19 | database: <%= `echo $(basename $PWD)_development` %> 20 | 21 | test: 22 | <<: *default 23 | database: <%= `echo $(basename $PWD)_test` %> 24 | 25 | production: 26 | <<: *default 27 | database: <%= `echo $(basename $PWD)_production` %> 28 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require File.expand_path('../application', __FILE__) 3 | 4 | # Initialize the Rails application. 5 | Application.initialize! 6 | -------------------------------------------------------------------------------- /config/environments/development.rb: -------------------------------------------------------------------------------- 1 | Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # In the development environment your application's code is reloaded on 5 | # every request. This slows down response time but is perfect for development 6 | # since you don't have to restart the web server when you make code changes. 7 | config.cache_classes = false 8 | 9 | # Do not eager load code on boot. 10 | config.eager_load = false 11 | 12 | # Show full error reports and disable caching. 13 | config.consider_all_requests_local = true 14 | config.action_controller.perform_caching = false 15 | 16 | # Don't care if the mailer can't send. 17 | config.action_mailer.raise_delivery_errors = false 18 | 19 | # Print deprecation notices to the Rails logger. 20 | config.active_support.deprecation = :log 21 | 22 | # Raise an error on page load if there are pending migrations 23 | config.active_record.migration_error = :page_load 24 | 25 | # Debug mode disables concatenation and preprocessing of assets. 26 | # This option may cause significant delays in view rendering with a large 27 | # number of complex assets. 28 | config.assets.debug = true 29 | end 30 | -------------------------------------------------------------------------------- /config/environments/production.rb: -------------------------------------------------------------------------------- 1 | Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # Code is not reloaded between requests. 5 | config.cache_classes = true 6 | 7 | # Eager load code on boot. This eager loads most of Rails and 8 | # your application in memory, allowing both thread web servers 9 | # and those relying on copy on write to perform better. 10 | # Rake tasks automatically ignore this option for performance. 11 | config.eager_load = true 12 | 13 | # Full error reports are disabled and caching is turned on. 14 | config.consider_all_requests_local = false 15 | config.action_controller.perform_caching = true 16 | 17 | # Enable Rack::Cache to put a simple HTTP cache in front of your application 18 | # Add `rack-cache` to your Gemfile before enabling this. 19 | # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid. 20 | # config.action_dispatch.rack_cache = true 21 | 22 | # Disable Rails's static asset server (Apache or nginx will already do this). 23 | config.serve_static_assets = false 24 | 25 | # Compress JavaScripts and CSS. 26 | config.assets.js_compressor = :uglifier 27 | # config.assets.css_compressor = :sass 28 | 29 | # Do not fallback to assets pipeline if a precompiled asset is missed. 30 | config.assets.compile = false 31 | 32 | # Generate digests for assets URLs. 33 | config.assets.digest = true 34 | 35 | # Version of your assets, change this if you want to expire all your assets. 36 | config.assets.version = '1.0' 37 | 38 | # Specifies the header that your server uses for sending files. 39 | # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache 40 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx 41 | 42 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 43 | # config.force_ssl = true 44 | 45 | # Set to :debug to see everything in the log. 46 | config.log_level = :info 47 | 48 | # Prepend all log lines with the following tags. 49 | # config.log_tags = [ :subdomain, :uuid ] 50 | 51 | # Use a different logger for distributed setups. 52 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) 53 | 54 | # Use a different cache store in production. 55 | # config.cache_store = :mem_cache_store 56 | 57 | # Enable serving of images, stylesheets, and JavaScripts from an asset server. 58 | # config.action_controller.asset_host = "http://assets.example.com" 59 | 60 | # Precompile additional assets. 61 | # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. 62 | # config.assets.precompile += %w( search.js ) 63 | 64 | # Ignore bad email addresses and do not raise email delivery errors. 65 | # Set this to true and configure the email server for immediate delivery to raise delivery errors. 66 | # config.action_mailer.raise_delivery_errors = false 67 | 68 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 69 | # the I18n.default_locale when a translation can not be found). 70 | config.i18n.fallbacks = true 71 | 72 | # Send deprecation notices to registered listeners. 73 | config.active_support.deprecation = :notify 74 | 75 | # Disable automatic flushing of the log to improve performance. 76 | # config.autoflush_log = false 77 | 78 | # Use default logging formatter so that PID and timestamp are not suppressed. 79 | config.log_formatter = ::Logger::Formatter.new 80 | end 81 | -------------------------------------------------------------------------------- /config/environments/test.rb: -------------------------------------------------------------------------------- 1 | Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # The test environment is used exclusively to run your application's 5 | # test suite. You never need to work with it otherwise. Remember that 6 | # your test database is "scratch space" for the test suite and is wiped 7 | # and recreated between test runs. Don't rely on the data there! 8 | config.cache_classes = true 9 | 10 | # Do not eager load code on boot. This avoids loading your whole application 11 | # just for the purpose of running a single test. If you are using a tool that 12 | # preloads Rails for running tests, you may have to set it to true. 13 | config.eager_load = false 14 | 15 | # Configure static asset server for tests with Cache-Control for performance. 16 | config.serve_static_assets = true 17 | config.static_cache_control = "public, max-age=3600" 18 | 19 | # Show full error reports and disable caching. 20 | config.consider_all_requests_local = true 21 | config.action_controller.perform_caching = false 22 | 23 | # Raise exceptions instead of rendering exception templates. 24 | config.action_dispatch.show_exceptions = false 25 | 26 | # Disable request forgery protection in test environment. 27 | config.action_controller.allow_forgery_protection = false 28 | 29 | # Tell Action Mailer not to deliver emails to the real world. 30 | # The :test delivery method accumulates sent emails in the 31 | # ActionMailer::Base.deliveries array. 32 | config.action_mailer.delivery_method = :test 33 | 34 | # Print deprecation notices to the stderr. 35 | config.active_support.deprecation = :stderr 36 | end 37 | -------------------------------------------------------------------------------- /config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | # Mime::Type.register_alias "text/html", :iphone 6 | -------------------------------------------------------------------------------- /config/initializers/secret_token.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Your secret key is used for verifying the integrity of signed cookies. 4 | # If you change this key, all old signed cookies will become invalid! 5 | 6 | # Make sure the secret is at least 30 characters and all random, 7 | # no regular words or you'll be exposed to dictionary attacks. 8 | # You can use `rake secret` to generate a secure secret key. 9 | 10 | # Make sure your secret_key_base is kept private 11 | # if you're sharing your code publicly. 12 | Application.config.secret_key_base = '7aeb6754f22aa61b14e035a13efac79a697ec32e4094b4515253ca0310b3750114f775c1b4c0d821ed4b58111bc76c2cf4b3ec0ae5aa0739fee6bc95a2b91a66' 13 | -------------------------------------------------------------------------------- /config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Application.config.session_store :cookie_store, key: '_rails4-bootstrap_session' 4 | -------------------------------------------------------------------------------- /config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] if respond_to?(:wrap_parameters) 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # To learn more, please read the Rails Internationalization guide 20 | # available at http://guides.rubyonrails.org/i18n.html. 21 | 22 | en: 23 | hello: "Hello world" 24 | -------------------------------------------------------------------------------- /config/routes.rb: -------------------------------------------------------------------------------- 1 | Application.routes.draw do 2 | 3 | begin 4 | require 'sidekiq/web' 5 | 6 | Sidekiq::Web.use(Rack::Auth::Basic) do |user, password| 7 | [user, password] == [ 8 | "admin", ENV['SIDEKIQ_PASSWORD'] || "password" 9 | ] 10 | end 11 | 12 | mount Sidekiq::Web => '/sidekiq' 13 | end 14 | 15 | match '(errors)/:status', to: 'errors#show', 16 | constraints: { status: /\d{3}/ }, 17 | defaults: { status: '500' }, 18 | via: :all 19 | 20 | end 21 | -------------------------------------------------------------------------------- /config/sidekiq.yml: -------------------------------------------------------------------------------- 1 | :concurrency: 5 2 | -------------------------------------------------------------------------------- /db/schema.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | # This file is auto-generated from the current state of the database. Instead 3 | # of editing this file, please use the migrations feature of Active Record to 4 | # incrementally modify your database, and then regenerate this schema definition. 5 | # 6 | # Note that this schema.rb definition is the authoritative source for your 7 | # database schema. If you need to create the application database on another 8 | # system, you should be using db:schema:load, not running all the migrations 9 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations 10 | # you'll amass, the slower it'll run and the greater likelihood for issues). 11 | # 12 | # It's strongly recommended that you check this file into your version control system. 13 | 14 | ActiveRecord::Schema.define(version: 0) do 15 | 16 | # These are extensions that must be enabled in order to support this database 17 | enable_extension "plpgsql" 18 | 19 | end 20 | -------------------------------------------------------------------------------- /db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) 7 | # Mayor.create(name: 'Emanuel', city: cities.first) 8 | -------------------------------------------------------------------------------- /lib/assets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sheerun/rails4-bootstrap/68140014f3f63b9b1164cccc96aa024d92f83465/lib/assets/.keep -------------------------------------------------------------------------------- /lib/tasks/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sheerun/rails4-bootstrap/68140014f3f63b9b1164cccc96aa024d92f83465/lib/tasks/.keep -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sheerun/rails4-bootstrap/68140014f3f63b9b1164cccc96aa024d92f83465/public/favicon.ico -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /spec/application/security_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | require File.expand_path("../../../config/environment", __FILE__) 4 | 5 | describe ActiveSupport do 6 | it 'should use Yajl as default backend' do 7 | expect(Yajl::Parser).to receive(:parse) 8 | ActiveSupport::JSON.decode('{}') 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /spec/controllers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sheerun/rails4-bootstrap/68140014f3f63b9b1164cccc96aa024d92f83465/spec/controllers/.keep -------------------------------------------------------------------------------- /spec/fixtures/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sheerun/rails4-bootstrap/68140014f3f63b9b1164cccc96aa024d92f83465/spec/fixtures/.keep -------------------------------------------------------------------------------- /spec/helpers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sheerun/rails4-bootstrap/68140014f3f63b9b1164cccc96aa024d92f83465/spec/helpers/.keep -------------------------------------------------------------------------------- /spec/integration/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sheerun/rails4-bootstrap/68140014f3f63b9b1164cccc96aa024d92f83465/spec/integration/.keep -------------------------------------------------------------------------------- /spec/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sheerun/rails4-bootstrap/68140014f3f63b9b1164cccc96aa024d92f83465/spec/mailers/.keep -------------------------------------------------------------------------------- /spec/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sheerun/rails4-bootstrap/68140014f3f63b9b1164cccc96aa024d92f83465/spec/models/.keep -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | ENV['RAILS_ENV'] = 'test' 2 | require File.join(File.dirname(__FILE__), '../config/environment.rb') 3 | 4 | ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration) 5 | 6 | # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration 7 | RSpec.configure do |config| 8 | config.run_all_when_everything_filtered = true 9 | 10 | config.filter_run :focus 11 | config.order = 'random' 12 | 13 | config.before(:suite) do 14 | DatabaseCleaner.strategy = :transaction 15 | DatabaseCleaner.clean_with(:truncation) 16 | end 17 | 18 | config.before(:each) do 19 | DatabaseCleaner.start 20 | end 21 | 22 | config.after(:each) do 23 | DatabaseCleaner.clean 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sheerun/rails4-bootstrap/68140014f3f63b9b1164cccc96aa024d92f83465/vendor/assets/javascripts/.keep -------------------------------------------------------------------------------- /vendor/assets/stylesheets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sheerun/rails4-bootstrap/68140014f3f63b9b1164cccc96aa024d92f83465/vendor/assets/stylesheets/.keep --------------------------------------------------------------------------------