# SslRequirement on Rails 2.0

**URL:** <https://www.ruby-forum.com/t/sslrequirement-on-rails-2-0/140736>\
**Category:** Rails\
**Created:** [June 18, 2008, 3:56am UTC](https://www.ruby-forum.com/t/sslrequirement-on-rails-2-0/140736 "2008-06-18T03:56:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adrianunderwater](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/8edcca/32.png) [@adrianunderwater](https://www.ruby-forum.com/u/adrianunderwater)\
**Post date:** [June 18, 2008, 3:56am UTC](https://www.ruby-forum.com/t/sslrequirement-on-rails-2-0/140736/1 "2008-06-18T03:56:16Z")

</div>

Hi All,

I’m fairly new to RoR and I’m having trouble using the plugin  
SslRequirement.

I have an ApplicationController which includes the SslRequirement as so:

class ApplicationController \< ActionController::Base  
include SslRequirement

I have another controller that inherits from ApplicationController

class ProductsController \< ApplicationController

and within that I have some actions that will require ssl:

```
before_filter :ssl_required, :only => [:buy, :show]

```

When I try an view either the show or buy pages I get the error:

undefined method `ssl\_required’ for #ProductsController:0x5771c58

Using public\_methods I have done logged output of the controller’s  
interface to see if the ssl\_required method is available, it is not part  
of the public interface. However using protected\_methods I can see that  
the ssl\_required? and ssl\_allowed? methods are available so it has  
inherited correctly.

So, does anyone know why I might be experiencing this?

Thanks in advance

Adrian

I can however see in

---

<div class="post-metadata">

**Author:** ![adrianunderwater](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/8edcca/32.png) [@adrianunderwater](https://www.ruby-forum.com/u/adrianunderwater)\
**Post date:** [June 18, 2008, 11:56am UTC](https://www.ruby-forum.com/t/sslrequirement-on-rails-2-0/140736/2 "2008-06-18T11:56:10Z")

</div>

Actually, I don’t have a clue, but maybe prepending “require  
‘ssl\_requirement’” to the particular file would do it.

What about using SSL for all pages? Would that be an potential  
workaround?

SSL could been done by NGINX for instance:  
[http://wiki.codemongers.com/NginxHttpSslModule](http://wiki.codemongers.com/NginxHttpSslModule)
