# Module Issue

**URL:** <https://www.ruby-forum.com/t/module-issue/156485>\
**Category:** Rails\
**Created:** [December 28, 2008, 8:41pm UTC](https://www.ruby-forum.com/t/module-issue/156485 "2008-12-28T20:41:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![doug](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/dbc845/32.png) [@doug](https://www.ruby-forum.com/u/doug)\
**Post date:** [December 28, 2008, 8:41pm UTC](https://www.ruby-forum.com/t/module-issue/156485/1 "2008-12-28T20:41:38Z")

</div>

If I have a module that looks like this:

module Mymod  
require ‘cgi’  
params=CGI.new  
end

and I call a particular webpage like this:

[http://www.mydomain.com/test1.html?test=value](http://www.mydomain.com/test1.html?test=value)

and the particular web page has code in it that looks like this:

\<% require mymod %\>

\<%= Mymod::params['test'] %\>

why does this bomb instead of displaying the word ‘test’?

If I move the contents of the module to the actual page, I can get it  
to work just fine (of course, under that condition I omit the  
‘Mymod::’).

How can I make this work?

Thanks for any input.

```
        ... doug

```

---

<div class="post-metadata">

**Author:** ![doug](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/dbc845/32.png) [@doug](https://www.ruby-forum.com/u/doug)\
**Post date:** [December 28, 2008, 9:16pm UTC](https://www.ruby-forum.com/t/module-issue/156485/2 "2008-12-28T21:16:49Z")

</div>

On Dec 28, 7:41 pm, doug [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> If I have a module that looks like this:
> 
> module Mymod  
> require ‘cgi’  
> params=CGI.new  
> end

This doesn’t make a params mehod on mymodule. It just creates a local  
variable.  
Not sure why you’re fiddling around with CGI though.

Fred

---

<div class="post-metadata">

**Author:** ![doug](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/dbc845/32.png) [@doug](https://www.ruby-forum.com/u/doug)\
**Post date:** [December 29, 2008, 12:40am UTC](https://www.ruby-forum.com/t/module-issue/156485/3 "2008-12-29T00:40:21Z")

</div>

> This doesn’t make a params mehod on mymodule. It just creates a local  
> variable.

Thanks.

> Not sure why you’re fiddling around with CGI though.

It’s a bit of a because-it’s-there type thing. I’m just playing  
around with some more basic Ruby code to see what I can and can’t do.  
I’m still at a loss as to how I would pass the params from the module  
to the code that is requiring it.

Thanks again for the input.

```
      ... doug
```
