Upgrade to 3.1 and introduce asset pipeline
This commit is contained in:
@@ -5,7 +5,8 @@ Bundler.require(:default, Rails.env) if defined?(Bundler)
|
||||
|
||||
module Nineminutes
|
||||
class Application < Rails::Application
|
||||
|
||||
config.autoload_once_paths += %W(#{config.root}/lib)
|
||||
|
||||
# enable caching in development mode
|
||||
config.action_controller.perform_caching = true
|
||||
config.action_controller.page_cache_directory = Rails.root.to_s+"/public/cache/"
|
||||
@@ -17,5 +18,11 @@ module Nineminutes
|
||||
config.encoding = "utf-8"
|
||||
|
||||
config.filter_parameters += [:password]
|
||||
|
||||
config.assets.enabled = true
|
||||
config.assets.version = '1.0'
|
||||
|
||||
# Defaults to '/assets'
|
||||
# config.assets.prefix = '/asset-files'
|
||||
end
|
||||
end
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
embed_assets: on
|
||||
embed_assets: off
|
||||
javascript_compressor: closure
|
||||
|
||||
package_path: jammit
|
||||
|
||||
javascripts:
|
||||
jquery:
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
secret_token: ""
|
||||
lastfm_api_key: ""
|
||||
secret_token:
|
||||
lastfm_api_key:
|
||||
bing_api_key:
|
||||
facebook:
|
||||
app_id: ""
|
||||
secret: ""
|
||||
app_id:
|
||||
secret:
|
||||
redis:
|
||||
development: ""
|
||||
production: ""
|
||||
development:
|
||||
production:
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
Nineminutes::Application.configure do
|
||||
# Settings specified here will take precedence over those in config/application.rb
|
||||
|
||||
|
||||
# Reloads modules and files in lib directory
|
||||
config.autoload_paths += %W(#{config.root}/lib)
|
||||
|
||||
|
||||
# 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 webserver when you make code changes.
|
||||
@@ -14,7 +14,6 @@ Nineminutes::Application.configure do
|
||||
|
||||
# Show full error reports and disable caching
|
||||
config.consider_all_requests_local = true
|
||||
config.action_view.debug_rjs = true
|
||||
config.action_controller.perform_caching = false
|
||||
|
||||
# Don't care if the mailer can't send
|
||||
@@ -26,5 +25,11 @@ Nineminutes::Application.configure do
|
||||
|
||||
# Only use best-standards-support built into browsers
|
||||
config.action_dispatch.best_standards_support = :builtin
|
||||
|
||||
# Do not compress assets
|
||||
config.assets.compress = false
|
||||
|
||||
# Expands the lines which load the assets
|
||||
config.assets.debug = true
|
||||
end
|
||||
|
||||
|
||||
@@ -47,4 +47,22 @@ Nineminutes::Application.configure do
|
||||
|
||||
# Send deprecation notices to registered listeners
|
||||
config.active_support.deprecation = :notify
|
||||
|
||||
# Compress JavaScripts and CSS
|
||||
config.assets.compress = true
|
||||
|
||||
# Don't fallback to assets pipeline if a precompiled asset is missed
|
||||
config.assets.compile = false
|
||||
|
||||
# Generate digests for assets URLs
|
||||
config.assets.digest = true
|
||||
|
||||
# Defaults to Rails.root.join("public/assets")
|
||||
# config.assets.manifest = YOUR_PATH
|
||||
|
||||
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
|
||||
# config.assets.precompile += %w( search.js )
|
||||
|
||||
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
||||
# config.force_ssl = true
|
||||
end
|
||||
|
||||
@@ -32,4 +32,8 @@ Nineminutes::Application.configure do
|
||||
|
||||
# Print deprecation notices to the stderr
|
||||
config.active_support.deprecation = :stderr
|
||||
|
||||
# Configure static asset server for tests with Cache-Control for performance
|
||||
config.serve_static_assets = true
|
||||
config.static_cache_control = "public, max-age=3600"
|
||||
end
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
ActionDispatch::Callbacks.to_prepare do
|
||||
LastFM::Request::api_key = ENV['LASTFM_API_KEY']
|
||||
end
|
||||
end
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
# 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 to an empty array.
|
||||
ActiveSupport.on_load(:action_controller) do
|
||||
wrap_parameters :format => [:json]
|
||||
end
|
||||
|
||||
# Disable root element in JSON by default.
|
||||
ActiveSupport.on_load(:active_record) do
|
||||
self.include_root_in_json = false
|
||||
end
|
||||
+8
-4
@@ -1,7 +1,11 @@
|
||||
Nineminutes::Application.routes.draw do
|
||||
|
||||
devise_for :users,
|
||||
:controllers => { :omniauth_callbacks => "users/omniauth_callbacks", :registrations => "devise_auth/registrations", :sessions => "devise_auth/sessions" }
|
||||
devise_for :users, :controllers => {
|
||||
:omniauth_callbacks => "users/omniauth_callbacks",
|
||||
:registrations => "devise_auth/registrations",
|
||||
:sessions => "devise_auth/sessions"
|
||||
}
|
||||
|
||||
devise_scope :user do
|
||||
get "/users/auth/:provider" => "users/omniauth_callbacks#passthru"
|
||||
get "/register" => "devise_auth/registrations#new", :as => :new_user_registration
|
||||
@@ -27,8 +31,8 @@ Nineminutes::Application.routes.draw do
|
||||
match "/charts", :to => "charts#index"
|
||||
|
||||
resources :users, :only => [ :show, :update, :edit, :create ]
|
||||
|
||||
|
||||
get "/home", :to => "home#index"
|
||||
|
||||
|
||||
root :to => "home#index"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user