# Ssl requirement plugin: exempting a couple of actions from ssl

**URL:** <https://www.ruby-forum.com/t/ssl-requirement-plugin-exempting-a-couple-of-actions-from-ssl/143573>\
**Category:** Rails\
**Created:** [July 20, 2008, 7:18pm UTC](https://www.ruby-forum.com/t/ssl-requirement-plugin-exempting-a-couple-of-actions-from-ssl/143573 "2008-07-20T19:18:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DavidB](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/76d3ee/32.png) [@DavidB](https://www.ruby-forum.com/u/DavidB)\
**Post date:** [July 20, 2008, 7:18pm UTC](https://www.ruby-forum.com/t/ssl-requirement-plugin-exempting-a-couple-of-actions-from-ssl/143573/1 "2008-07-20T19:18:02Z")

</div>

I am wondering the cleanest way to selectively enforce SSL.

Say I have an application with 10 controllers, each with 5 actions. I  
want SSL on all actions except for 2.

Rather than having ‘ssl\_required :action1, :action2, :action3, etc’ in  
each controller, I thought, the best way would be to put it in the  
application.rb file. by modifying def ssl\_required? call. My solution  
was to look for certain action names in the request object using Ruby  
String class functions, but I would be surprised if there was not an  
easier way to just using something.

Thanks.

David
