Created
June 28, 2011 14:59
-
-
Save 8th-Light-Blog/1051319 to your computer and use it in GitHub Desktop.
This file contains 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
Blog Title: One Take on Configuring Rails Routes and asset_host (Part 1) | |
Author: Jim Suchy | |
Date: December 2nd, 2008 |
This file contains 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
/deployment | |
/deployment/system_one | |
/deployment/system_one/etc | |
/deployment/system_one/etc/config.rb | |
/deployment/system_one/rails_app_one | |
/deployment/system_one/non_rails_subsystem_one |
This file contains 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
APPLICATION_CONFIGURATION ||= {} | |
APPLICATION_CONFIGURATION[:foo] = "bar" |
This file contains 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
# Load the system configuration | |
require File.expand_path("/deployment/system_one/etc/config") | |
# Bootstrap the Rails environment, frameworks, and default configuration | |
require File.join(File.dirname(__FILE__), 'boot') |
This file contains 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
deployment/config | |
deployment/config/server_config.rb |
This file contains 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
# Allow for configuration to be overridden by | |
# a config file that is not under source control | |
server_config_file = File.expand_path("/deployment/config/server_config.rb") | |
require server_config_file if File.exists?(server_config_file) |
This file contains 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
APPLICATION_CONFIGURATION[:my_rails_app_asset_host] = "https://www.example.com/my_rails_app/demo" |
This file contains 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
config.action_controller.asset_host = APPLICATION_CONFIGURATION[:my_rails_app_asset_host] |
This file contains 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
ActionController::Routing::Routes.draw do |map| | |
map.connect ':controller/:action/:id' | |
end |
This file contains 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
APPLICATION_CONFIGURATION[:my_rails_app_routes] = lambda do |map| | |
map.connect 'my_rails_app/demo/:controller/:action/:id' | |
map.connect 'my_rails_app/demo', :controller => "login", :action => "index" | |
map.login 'my_rails_app/demo/login', :controller => "login", :action => "index" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment