Ruby on Rails Wednesday, April 28, 2010

I'm working on the client side, the server had been applied with SSL.
In my client, If the server is secured with SSL, the https shall be used
automatically, or say "redirecting";
otherwise only use http to access the server.
I didn't know how to implement.
I want to using ssl_required plugin as some direction, but not succeed.
I installed ssl_requirement plugin.
Then in coding as:
require "ssl_requirement"
class MyController < ApplicationController
include SslRequirement
ssl_allowed :update
##I tried ssl_required :update An error occurred, saying:
##The page is temporarily unavailable. (IIS-404)
##while for ssl_allowed :update the https still can't be used, only go
to http.

def update
.........
respond_to do |format|
format.html {
redirect_to ( RelativeUrlfromLocalHost )
}
end
end
It doesn't work.

In ssl_required plugin, I saw the judgment :
if ssl_required? && !request.ssl?
However, I'm not clear what is request here ? How can I "bind" it to
my accessing server.
Is there anyone can help me?
Thanks alot!!
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment