Hello nerds, I want to discuss approach to this situation: I have one rails app and I want to make only part of, not whole app, running on https. I know, that https is question of configuring web server. The only solution I worked out, is to split app into two, one running with ssl. But I want to avoid splitting application. It is possible? Thanks for every reply.
on 2009-09-08 10:50
on 2010-01-04 21:02
Well, you can use :protocol => 'https://' as a parameter value in redirect_to call. But be sure it will work only if you are using url as hash values. It will not work on relative urls. The best way would be to add a before_filter method and decide on your condition and redirect the protocol as https://. one example might be like this: def require_https redirect_to :protocol => "https://" unless (request.ssl? or local_request? or request.post? or ENV["RAILS_ENV"]=="development") end Frantisek Psotka wrote: > Hello nerds, > > I want to discuss approach to this situation: I have one rails app and I > want to make only part of, not whole app, running on https. > > I know, that https is question of configuring web server. The only > solution I worked out, is to split app into two, one running with ssl. > But I want to avoid splitting application. It is possible? > > Thanks for every reply.