Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Partial SSL in rails

I'm looking to do a partial SSL site in rails. I basically want to protect the user actions behind SSL, but nothing else.

Anyone know of a plugin or gem that makes this simple and efficient?

like image 412
Dan Frade Avatar asked Apr 27 '09 20:04

Dan Frade


3 Answers

This is typically done with the SSL Requirement plugin. It sets up before_filters allowing you to specify which actions require SSL and which optionally allow it, and which specifically do not allow it.

Outside of that, it's just a matter of setting up 2 VHosts in your Apache (or whichever server you use) configuration, one for the SSL site and one for the non-SSL site.

like image 56
John Douthat Avatar answered Nov 17 '22 21:11

John Douthat


You can try ssl_requirement. It lets you specify what you want.

like image 21
Brian Avatar answered Nov 17 '22 22:11

Brian


ssl_routes gem defines ssl enforcement rule in the route file. It also will automatically output the url with the correct protocol to prevent redirects.

like image 1
lulalala Avatar answered Nov 17 '22 20:11

lulalala