require 'actionpack'
ActionController.host_with_port
and gives me this error: "undefined method 'host_with_port' for
ActionController::Module (NoMethodError)". How do you? It is defined
precisely in that module... I hope that to help me because I do not come
out.
PS: I use rails 2.3.4
--
Posted via http://www.ruby-forum.com/.
I noticed that the host_with_port method works safely all controller or
view, but if I go to use it in config/environment.rb setting a filter
rubycas logout so:
CASClient: Frameworks:Rails: configure () Filter.
: logout_url =
"https://mioservercas/logout?service=http://#{host_with_port}/"
}
tells me that the host_with_port method is undefined... I do the require
something? I repeat that this method don't works only in
config/environment.rb. I hope have been clearer.
CASClient::Frameworks::Rails::Filter.configure(
:cas_base_url => "https://myservercas/",
...
:logout_url =>
"https://myservercas/logout?service=http://#{request.host_with_port}",
...
)
and to do so I must change config/environment.rb,but in this file tell
me that the request.host_with_port method is undefined...help me :(
ok but if i use this method so:
line50:$hostname= request.host_with_port
line51:CASClient::Frameworks::Rails::Filter.configure(
line52:...
line53: :logout_url =>
line54: "https://myservercas/logout?service=http://#{$hostname}",
line55:...
line56:)
gives me the same error(undefined method request...at line50).I'm in the
presence of a request here.I couldn't use "request" and "host_with_port"
in environment.rb,because they are undefined.Why? :(