ruby - Specifying rails 4 host per environment -


using rails 4.0.0 , ruby 2.0.0

i looking @ _urls , _paths in rails console , noticed

2.0.0p247 :001 > app.host  => "www.example.com" 2.0.0p247 :001 > app.root_url  => "http://www.example.com/" 

is setting host www.example.com default behavior upon rails c startup or there config somewhere sets domain? if so, how set app.host variable/config per environment?

in rails 4 console, app.host , access "integration session": seemingly placeholder console work completely. apparently, app host not configurable. see railties gem.

exert v4.0.2: railties-4.0.2/lib/rails/console/app.rb

module rails   module consolemethods     def app(create=false)       @app_integration_instance = nil if create       @app_integration_instance ||= new_session |sess|         sess.host! "www.example.com"       end     end      def new_session       app = rails.application       session = actiondispatch::integration::session.new(app)       yield session if block_given?       session     end   end end 

the new_session method allows choose host, though.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -