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
Post a Comment