This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
protect_from_forgery with: :exception | |
if Rails.env.production? | |
rescue_from Exception, with: :error500 | |
rescue_from ActiveRecord::RecordNotFound, ActionController::RoutingError, with: :error404 | |
end | |
def error404 | |
render 'error404', status: 404, formats: [:html] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.row | |
.col.s12.m6.offset-m3 | |
.section | |
.section | |
.section | |
.card-panel.red.darken-1.center-align.white-text | |
.section | |
i.material-icons.medium error | |
h6 Page Not Found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.row | |
.col.s12.m6.offset-m3 | |
.section | |
.section | |
.section | |
.card-panel.red.darken-1.center-align.white-text | |
.section | |
i.material-icons.medium error | |
h6 Out of Service. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.routes.draw do | |
mount API => '/api/' | |
get 'welcome/index' | |
root to: 'welcome#index' | |
match '*path' => 'application#error404', via: :all | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.configure do | |
config.cache_classes = false | |
config.eager_load = false | |
config.consider_all_requests_local = true | |
config.action_controller.perform_caching = false | |
config.action_mailer.raise_delivery_errors = false | |
config.active_support.deprecation = :log | |
config.active_record.migration_error = :page_load | |
config.assets.debug = true | |
config.assets.digest = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.configure do | |
config.cache_classes = true | |
config.eager_load = true | |
config.consider_all_requests_local = false | |
config.action_controller.perform_caching = true | |
config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present? | |
config.assets.js_compressor = :uglifier | |
config.assets.compile = false | |
config.assets.digest = true | |
config.log_level = :debug |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Member < ActiveRecord::Base | |
devise :database_authenticatable, :registerable, :rememberable, :trackable, :validatable | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DeviseCreateMembers < ActiveRecord::Migration | |
def change | |
create_table(:members) do |t| | |
# Database authenticatable | |
t.string :email, null: false, default: '' | |
t.string :encrypted_password, null: false, default: '' | |
# Rememberable | |
t.datetime :remember_created_at |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.routes.draw do | |
mount API => '/api/' | |
get 'welcome/index' | |
root to: 'welcome#index' | |
devise_for :members, path: :member, controllers: { | |
registrations: 'member/members/registrations', | |
sessions: 'member/members/sessions', | |
} | |
namespace :member do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Devise.setup do |config| | |
require 'devise/orm/active_record' | |
config.mailer_sender = '[email protected]' | |
config.case_insensitive_keys = [:email] | |
config.strip_whitespace_keys = [:email] | |
config.skip_session_storage = [:http_auth] | |
config.stretches = Rails.env.test? ? 1 : 10 | |
config.reconfirmable = true | |
config.expire_all_remember_me_on_sign_out = true | |
config.password_length = 8..72 |