Introduction
Introduction Statistics Contact Development Disclaimer Help
Upgrade to Rails 4.2 - warvox - VoIP based wardialing tool, forked from rapid7/…
Log
Files
Refs
README
---
commit 598eb2fb1ce09f6c2848f1f5a5514cc498accf51
parent cdf16415fb0596b0155a03692ad7f58319405d61
Author: Chee Yeo <[email protected]>
Date: Thu, 18 Aug 2016 16:58:40 +0100
Upgrade to Rails 4.2
Diffstat:
M Gemfile | 2 +-
M Gemfile.lock | 88 +++++++++++++++++++----------…
A bin/bundle | 3 +++
A bin/rails | 4 ++++
A bin/rake | 4 ++++
A bin/setup | 29 +++++++++++++++++++++++++++++
M config/application.rb | 57 ++++++-----------------------…
M config/boot.rb | 5 +----
M config/environment.rb | 7 +++----
M config/environments/development.rb | 40 +++++++++++++++++++----------…
M config/environments/production.rb | 80 ++++++++++++++++++-----------…
M config/environments/test.rb | 39 +++++++++++++++++------------…
A config/initializers/assets.rb | 13 +++++++++++++
A config/initializers/cookies_serial… | 3 +++
A config/initializers/filter_paramet… | 4 ++++
M config/initializers/inflections.rb | 11 ++++++-----
M config/initializers/mime_types.rb | 1 -
M config/initializers/session_store.… | 7 +------
M config/initializers/wrap_parameter… | 12 ++++++------
M config/locales/en.yml | 22 ++++++++++++++++++++--
M config/routes.rb | 3 +--
21 files changed, 255 insertions(+), 179 deletions(-)
---
diff --git a/Gemfile b/Gemfile
@@ -1,7 +1,7 @@
source 'https://rubygems.org'
gem 'unicorn'
-gem 'rails', '4.1.16'
+gem 'rails', '4.2.0'
gem 'pg', '>=0.17'
gem 'jquery-rails', '>= 3.1.2'
diff --git a/Gemfile.lock b/Gemfile.lock
@@ -19,37 +19,46 @@ GIT
GEM
remote: https://rubygems.org/
specs:
- actionmailer (4.1.16)
- actionpack (= 4.1.16)
- actionview (= 4.1.16)
+ actionmailer (4.2.0)
+ actionpack (= 4.2.0)
+ actionview (= 4.2.0)
+ activejob (= 4.2.0)
mail (~> 2.5, >= 2.5.4)
- actionpack (4.1.16)
- actionview (= 4.1.16)
- activesupport (= 4.1.16)
- rack (~> 1.5.2)
+ rails-dom-testing (~> 1.0, >= 1.0.5)
+ actionpack (4.2.0)
+ actionview (= 4.2.0)
+ activesupport (= 4.2.0)
+ rack (~> 1.6.0)
rack-test (~> 0.6.2)
- actionview (4.1.16)
- activesupport (= 4.1.16)
+ rails-dom-testing (~> 1.0, >= 1.0.5)
+ rails-html-sanitizer (~> 1.0, >= 1.0.1)
+ actionview (4.2.0)
+ activesupport (= 4.2.0)
builder (~> 3.1)
erubis (~> 2.7.0)
- activemodel (4.1.16)
- activesupport (= 4.1.16)
+ rails-dom-testing (~> 1.0, >= 1.0.5)
+ rails-html-sanitizer (~> 1.0, >= 1.0.1)
+ activejob (4.2.0)
+ activesupport (= 4.2.0)
+ globalid (>= 0.3.0)
+ activemodel (4.2.0)
+ activesupport (= 4.2.0)
builder (~> 3.1)
- activerecord (4.1.16)
- activemodel (= 4.1.16)
- activesupport (= 4.1.16)
- arel (~> 5.0.0)
- activesupport (4.1.16)
- i18n (~> 0.6, >= 0.6.9)
+ activerecord (4.2.0)
+ activemodel (= 4.2.0)
+ activesupport (= 4.2.0)
+ arel (~> 6.0)
+ activesupport (4.2.0)
+ i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
- thread_safe (~> 0.1)
+ thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.4.0)
annotate (2.7.1)
activerecord (>= 3.2, < 6.0)
rake (>= 10.4, < 12.0)
- arel (5.0.1.20140414130214)
+ arel (6.0.3)
authlogic (3.4.6)
activerecord (>= 3.2)
activesupport (>= 3.2)
@@ -110,6 +119,8 @@ GEM
actionpack (>= 3.2.13)
formtastic-bootstrap (3.1.1)
formtastic (>= 3.0)
+ globalid (0.3.7)
+ activesupport (>= 4.1.0)
guard (2.14.0)
formatador (>= 0.2.4)
listen (>= 2.7, < 4.0)
@@ -154,6 +165,8 @@ GEM
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
+ loofah (2.0.3)
+ nokogiri (>= 1.5.9)
lumberjack (1.0.10)
mail (2.6.4)
mime-types (>= 1.16, < 4)
@@ -181,25 +194,34 @@ GEM
method_source (~> 0.8.1)
slop (~> 3.4)
psych_shield (0.0.4)
- rack (1.5.5)
+ rack (1.6.4)
rack-test (0.6.3)
rack (>= 1.0)
- rails (4.1.16)
- actionmailer (= 4.1.16)
- actionpack (= 4.1.16)
- actionview (= 4.1.16)
- activemodel (= 4.1.16)
- activerecord (= 4.1.16)
- activesupport (= 4.1.16)
+ rails (4.2.0)
+ actionmailer (= 4.2.0)
+ actionpack (= 4.2.0)
+ actionview (= 4.2.0)
+ activejob (= 4.2.0)
+ activemodel (= 4.2.0)
+ activerecord (= 4.2.0)
+ activesupport (= 4.2.0)
bundler (>= 1.3.0, < 2.0)
- railties (= 4.1.16)
- sprockets-rails (~> 2.0)
+ railties (= 4.2.0)
+ sprockets-rails
+ rails-deprecated_sanitizer (1.0.3)
+ activesupport (>= 4.2.0.alpha)
+ rails-dom-testing (1.0.7)
+ activesupport (>= 4.2.0.beta, < 5.0)
+ nokogiri (~> 1.6.0)
+ rails-deprecated_sanitizer (>= 1.0.1)
+ rails-html-sanitizer (1.0.3)
+ loofah (~> 2.0)
rails-settings-cached (0.4.1)
rails (>= 4.0.0)
rails_layout (1.0.29)
- railties (4.1.16)
- actionpack (= 4.1.16)
- activesupport (= 4.1.16)
+ railties (4.2.0)
+ actionpack (= 4.2.0)
+ activesupport (= 4.2.0)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
raindrops (0.16.0)
@@ -323,7 +345,7 @@ DEPENDENCIES
pg (>= 0.17)
protected_attributes (~> 1.0.7)
psych_shield
- rails (= 4.1.16)
+ rails (= 4.2.0)
rails-settings-cached (>= 0.4.1)
rails_layout
reportable!
diff --git a/bin/bundle b/bin/bundle
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
+load Gem.bin_path('bundler', 'bundle')
diff --git a/bin/rails b/bin/rails
@@ -0,0 +1,4 @@
+#!/usr/bin/env ruby
+APP_PATH = File.expand_path('../../config/application', __FILE__)
+require_relative '../config/boot'
+require 'rails/commands'
diff --git a/bin/rake b/bin/rake
@@ -0,0 +1,4 @@
+#!/usr/bin/env ruby
+require_relative '../config/boot'
+require 'rake'
+Rake.application.run
diff --git a/bin/setup b/bin/setup
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+require 'pathname'
+
+# path to your application root.
+APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
+
+Dir.chdir APP_ROOT do
+ # This script is a starting point to setup your application.
+ # Add necessary setup steps to this file:
+
+ puts "== Installing dependencies =="
+ system "gem install bundler --conservative"
+ system "bundle check || bundle install"
+
+ # puts "\n== Copying sample files =="
+ # unless File.exist?("config/database.yml")
+ # system "cp config/database.yml.sample config/database.yml"
+ # end
+
+ puts "\n== Preparing database =="
+ system "bin/rake db:setup"
+
+ puts "\n== Removing old logs and tempfiles =="
+ system "rm -f log/*"
+ system "rm -rf tmp/cache"
+
+ puts "\n== Restarting application server =="
+ system "touch tmp/restart.txt"
+end
diff --git a/config/application.rb b/config/application.rb
@@ -1,16 +1,10 @@
require File.expand_path('../boot', __FILE__)
-require 'rails/all'
-# Bootstrap the WarVOX code base
-$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
-require 'warvox'
+require 'rails/all'
-if defined?(Bundler)
- # If you precompile assets before deploying to production, use this line
- Bundler.require(*Rails.groups(:assets => %w(development test)))
- # If you want your assets lazily compiled in production, use this line
- # Bundler.require(:default, :assets, Rails.env)
-end
+# Require the gems listed in Gemfile, including any gems
+# you've limited to :test, :development, or :production.
+Bundler.require(*Rails.groups)
module Web
class Application < Rails::Application
@@ -18,16 +12,6 @@ module Web
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
- # Custom directories with classes and modules you want to be autoloadable.
- # config.autoload_paths += %W(#{config.root}/extras)
-
- # Only load the plugins named here, in the order given (default is alphabe…
- # :all can be used as a placeholder for all plugins not explicitly named.
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
-
- # Activate observers that should always be running.
- # config.active_record.observers = :cacher, :garbage_collector, :forum_obs…
-
# Set Time.zone default to the specified zone and make Active Record auto-…
# Run "rake -D time" for a list of tasks for finding time zone names. Defa…
# config.time_zone = 'Central Time (US & Canada)'
@@ -36,37 +20,16 @@ module Web
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml…
# config.i18n.default_locale = :de
- # Configure the default encoding used in templates for Ruby 1.9.
- config.encoding = "utf-8"
+ # Bootstrap the WarVOX code base
+ config.autoload_paths << "#{Rails.root}/lib"
+ require 'warvox'
- # Configure sensitive parameters which will be filtered from the log file.
- config.filter_parameters += [:password, :pass, :password, :password_confir…
+ config.encoding = "utf-8"
# Enable escaping HTML in JSON.
config.active_support.escape_html_entities_in_json = true
- # Use SQL instead of Active Record's schema dumper when creating the datab…
- # This is necessary if your schema can't be completely dumped by the schem…
- # like if you have constraints or database-specific column types
- # config.active_record.schema_format = :sql
-
- # Enforce whitelist mode for mass assignment.
- # This will create an empty whitelist of attributes available for mass-ass…
- # in your app. As such, your models will need to explicitly whitelist or b…
- # parameters by using an attr_accessible or attr_protected declaration.
- config.active_record.whitelist_attributes = true
-
- # Enable the asset pipeline
- config.assets.enabled = true
-
- # Version of your assets, change this if you want to expire all your assets
- config.assets.version = '1.0'
-
- # Config I8n
- I18n.enforce_available_locales = false
-
- # Configure sensitive parameters which will be filtered from the log file.
- config.session_store :cookie_store, :key => "_warvox"
- config.secret_token = WarVOX::Config.load_session_key
+ # Do not swallow errors in after_commit/after_rollback callbacks.
+ config.active_record.raise_in_transactional_callbacks = true
end
end
diff --git a/config/boot.rb b/config/boot.rb
@@ -1,6 +1,3 @@
-require 'rubygems'
-
-# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
-require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
+require 'bundler/setup' # Set up gems listed in the Gemfile.
diff --git a/config/environment.rb b/config/environment.rb
@@ -1,6 +1,5 @@
-# Load the rails application
+# Load the Rails application.
require File.expand_path('../application', __FILE__)
-# Initialize the rails application
-Web::Application.initialize!
-
+# Initialize the Rails application.
+Rails.application.initialize!
diff --git a/config/environments/development.rb b/config/environments/developme…
@@ -1,40 +1,48 @@
-Web::Application.configure do
- # Settings specified here will take precedence over those in config/applicat…
+Rails.application.configure do
+ # Settings specified here will take precedence over those in config/applicat…
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
- # Log error messages when you accidentally call methods on nil.
- config.whiny_nils = true
+ # Do not eager load code on boot.
+ config.eager_load = false
- # Show full error reports and disable caching
+ # Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
- # Don't care if the mailer can't send
+ # Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false
- # Print deprecation notices to the Rails logger
+ # Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
- # Only use best-standards-support built into browsers
- config.action_dispatch.best_standards_support = :builtin
-
- # Raise exception on mass assignment protection for Active Record models
- config.active_record.mass_assignment_sanitizer = :strict
+ # Raise an error on page load if there are pending migrations.
+ config.active_record.migration_error = :page_load
config.log_level = :debug
# Do not compress assets
config.assets.compress = false
- # Expands the lines which load the assets
+ # Debug mode disables concatenation and preprocessing of assets.
+ # This option may cause significant delays in view rendering with a large
+ # number of complex assets.
config.assets.debug = false
- # Eager load
- config.eager_load = false
+ config.serve_static_files = true
+
+ # Asset digests allow you to set far-future HTTP expiration dates on all ass…
+ # yet still be able to expire them through the digest params.
+ config.assets.digest = true
+
+ # Adds additional error checking when serving assets at runtime.
+ # Checks for improperly declared sprockets dependencies.
+ # Raises helpful error messages.
+ config.assets.raise_runtime_errors = true
- config.serve_static_assets = true
+ # Raises error for missing translations
+ # config.action_view.raise_on_missing_translations = true
end
diff --git a/config/environments/production.rb b/config/environments/production…
@@ -1,67 +1,79 @@
-Web::Application.configure do
- # Settings specified here will take precedence over those in config/applicat…
+Rails.application.configure do
+ # Settings specified here will take precedence over those in config/applicat…
- # Code is not reloaded between requests
+ # Code is not reloaded between requests.
config.cache_classes = true
- # Full error reports are disabled and caching is turned on
+ # Eager load code on boot. This eager loads most of Rails and
+ # your application in memory, allowing both threaded web servers
+ # and those relying on copy on write to perform better.
+ # Rake tasks automatically ignore this option for performance.
+ config.eager_load = true
+
+ # Full error reports are disabled and caching is turned on.
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
- # Disable Rails's static asset server (Apache or nginx will already do this)
- config.serve_static_files = true
+ # Enable Rack::Cache to put a simple HTTP cache in front of your application
+ # Add `rack-cache` to your Gemfile before enabling this.
+ # For large-scale production use, consider using a caching reverse proxy like
+ # NGINX, varnish or squid.
+ # config.action_dispatch.rack_cache = true
+
+ # Disable serving static files from the `/public` folder by default since
+ # Apache or NGINX already handles this.
+ config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
- # Compress JavaScripts and CSS
- config.assets.compress = false
+ # Compress JavaScripts and CSS.
+ config.assets.js_compressor = :uglifier
+ # config.assets.css_compressor = :sass
- # Don't fallback to assets pipeline if a precompiled asset is missed
- config.assets.compile = true
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
+ config.assets.compile = false
- # Generate digests for assets URLs
+ # Asset digests allow you to set far-future HTTP expiration dates on all ass…
+ # yet still be able to expire them through the digest params.
config.assets.digest = true
- # Defaults to nil and saved in location specified by config.assets.prefix
- # config.assets.manifest = YOUR_PATH
+ # `config.assets.precompile` and `config.assets.version` have moved to confi…
- # Specifies the header that your server uses for sending files
- # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
+ # Specifies the header that your server uses for sending files.
+ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
# Force all access to the app over SSL, use Strict-Transport-Security, and u…
# config.force_ssl = true
- # See everything in the log (default is :info)
- config.log_level = :warn
+ # Use the lowest log level to ensure availability of diagnostic information
+ # when problems arise.
+ config.log_level = :debug
- # Prepend all log lines with the following tags
+ # Prepend all log lines with the following tags.
# config.log_tags = [ :subdomain, :uuid ]
- # Use a different logger for distributed setups
+ # Use a different logger for distributed setups.
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
- # Use a different cache store in production
+ # Use a different cache store in production.
# config.cache_store = :mem_cache_store
- # Enable serving of images, stylesheets, and JavaScripts from an asset server
- # config.action_controller.asset_host = "http://assets.example.com"
+ # Enable serving of images, stylesheets, and JavaScripts from an asset serve…
+ # config.action_controller.asset_host = 'http://assets.example.com'
- # Precompile additional assets (application.js, application.css, and all non…
- config.assets.precompile += %w( jquery.js )
-
- # Disable delivery errors, bad email addresses will be ignored
+ # Ignore bad email addresses and do not raise email delivery errors.
+ # Set this to true and configure the email server for immediate delivery to …
# config.action_mailer.raise_delivery_errors = false
- # Enable threaded mode
- # config.threadsafe!
-
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
- # the I18n.default_locale when a translation can not be found)
+ # the I18n.default_locale when a translation cannot be found).
config.i18n.fallbacks = true
- # Send deprecation notices to registered listeners
+ # Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify
- # Eager load
- config.eager_load = true
+ # Use default logging formatter so that PID and timestamp are not suppressed.
+ config.log_formatter = ::Logger::Formatter.new
+ # Do not dump schema after migrations.
+ config.active_record.dump_schema_after_migration = false
end
diff --git a/config/environments/test.rb b/config/environments/test.rb
@@ -1,39 +1,42 @@
-Web::Application.configure do
- # Settings specified here will take precedence over those in config/environm…
+Rails.application.configure do
+ # Settings specified here will take precedence over those in config/applicat…
# The test environment is used exclusively to run your application's
- # test suite. You never need to work with it otherwise. Remember that
+ # test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
- # and recreated between test runs. Don't rely on the data there!
+ # and recreated between test runs. Don't rely on the data there!
config.cache_classes = true
- # Log error messages when you accidentally call methods on nil.
- config.whiny_nils = true
+ # Do not eager load code on boot. This avoids loading your whole application
+ # just for the purpose of running a single test. If you are using a tool that
+ # preloads Rails for running tests, you may have to set it to true.
+ config.eager_load = false
+
+ # Configure static file server for tests with Cache-Control for performance.
+ config.serve_static_files = true
+ config.static_cache_control = 'public, max-age=3600'
- # Show full error reports and disable caching
+ # Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
- # Raise exceptions instead of rendering exception templates
+ # Raise exceptions instead of rendering exception templates.
config.action_dispatch.show_exceptions = false
- # Disable request forgery protection in test environment
- config.action_controller.allow_forgery_protection = false
+ # Disable request forgery protection in test environment.
+ config.action_controller.allow_forgery_protection = false
# Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
- # Use SQL instead of Active Record's schema dumper when creating the test da…
- # This is necessary if your schema can't be completely dumped by the schema …
- # like if you have constraints or database-specific column types
- # config.active_record.schema_format = :sql
+ # Randomize the order test cases are executed.
+ config.active_support.test_order = :random
- # Print deprecation notices to the stderr
+ # Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr
- # Eager load
- config.eager_load = false
-
+ # Raises error for missing translations
+ # config.action_view.raise_on_missing_translations = true
end
diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb
@@ -0,0 +1,13 @@
+# Be sure to restart your server when you modify this file.
+
+# Version of your assets, change this if you want to expire all your assets.
+Rails.application.config.assets.version = '1.0'
+
+# Add additional assets to the asset load path
+# Rails.application.config.assets.paths << Emoji.images_path
+
+# Precompile additional assets.
+# application.js, application.css, and all non-JS/CSS in app/assets folder are…
+# Rails.application.config.assets.precompile += %w( search.js )
+
+ Rails.application.config.assets.precompile += %w( jquery.js )
diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/co…
@@ -0,0 +1,3 @@
+# Be sure to restart your server when you modify this file.
+
+Rails.application.config.action_dispatch.cookies_serializer = :marshal
diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializ…
@@ -0,0 +1,4 @@
+# Be sure to restart your server when you modify this file.
+
+# Configure sensitive parameters which will be filtered from the log file.
+Rails.application.config.filter_parameters += [:password, :pass, :password, :p…
diff --git a/config/initializers/inflections.rb b/config/initializers/inflectio…
@@ -1,15 +1,16 @@
# Be sure to restart your server when you modify this file.
-# Add new inflection rules using the following format
-# (all these examples are active by default):
-# ActiveSupport::Inflector.inflections do |inflect|
+# Add new inflection rules using the following format. Inflections
+# are locale specific, and you may define rules for as many different
+# locales as you wish. All of these examples are active by default:
+# ActiveSupport::Inflector.inflections(:en) do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', 'people'
# inflect.uncountable %w( fish sheep )
# end
-#
+
# These inflection rules are supported but not enabled by default:
-# ActiveSupport::Inflector.inflections do |inflect|
+# ActiveSupport::Inflector.inflections(:en) do |inflect|
# inflect.acronym 'RESTful'
# end
diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types…
@@ -2,4 +2,3 @@
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
-# Mime::Type.register_alias "text/html", :iphone
diff --git a/config/initializers/session_store.rb b/config/initializers/session…
@@ -1,8 +1,3 @@
# Be sure to restart your server when you modify this file.
-Web::Application.config.session_store :cookie_store, key: '_warvox_session'
-
-# Use the database for sessions instead of the cookie-based default,
-# which shouldn't be used to store highly confidential information
-# (create the session table with "rails generate session_migration")
-# Ttt::Application.config.session_store :active_record_store
+Rails.application.config.session_store :cookie_store, key: '_warvox_session'
diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_…
@@ -1,14 +1,14 @@
# Be sure to restart your server when you modify this file.
-#
+
# This file contains settings for ActionController::ParamsWrapper which
# is enabled by default.
# Enable parameter wrapping for JSON. You can disable this by setting :format …
ActiveSupport.on_load(:action_controller) do
- wrap_parameters format: [:json]
+ wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
end
-# Disable root element in JSON by default.
-ActiveSupport.on_load(:active_record) do
- self.include_root_in_json = false
-end
+# To enable root element in JSON for ActiveRecord objects.
+# ActiveSupport.on_load(:active_record) do
+# self.include_root_in_json = true
+# end
diff --git a/config/locales/en.yml b/config/locales/en.yml
@@ -1,5 +1,23 @@
-# Sample localization file for English. Add more files in this directory for o…
-# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for st…
+# Files in the config/locales directory are used for internationalization
+# and are automatically loaded by Rails. If you want to use locales other
+# than English, add the necessary files in this directory.
+#
+# To use the locales, use `I18n.t`:
+#
+# I18n.t 'hello'
+#
+# In views, this is aliased to just `t`:
+#
+# <%= t('hello') %>
+#
+# To use a different locale, set it with `I18n.locale`:
+#
+# I18n.locale = :es
+#
+# This would use the information in config/locales/es.yml.
+#
+# To learn more, please read the Rails Internationalization guide
+# available at http://guides.rubyonrails.org/i18n.html.
en:
hello: "Hello world"
diff --git a/config/routes.rb b/config/routes.rb
@@ -1,5 +1,4 @@
-Web::Application.routes.draw do
-
+Rails.application.routes.draw do
get "login" => "user_sessions#new", :as => "login"
get "logout" => "user_sessions#destroy", :as => "logout"
You are viewing proxied material from jay.scot. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.