# Use of #h method in a controller

**URL:** <https://www.ruby-forum.com/t/use-of-h-method-in-a-controller/156626>\
**Category:** Rails\
**Created:** [December 31, 2008, 4:00am UTC](https://www.ruby-forum.com/t/use-of-h-method-in-a-controller/156626 "2008-12-31T04:00:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![oldbug](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/c0e974/32.png) [@oldbug](https://www.ruby-forum.com/u/oldbug)\
**Post date:** [December 31, 2008, 4:00am UTC](https://www.ruby-forum.com/t/use-of-h-method-in-a-controller/156626/1 "2008-12-31T04:00:48Z")

</div>

I have rails-2.2.2 installed on 2 different computers and routinely  
switch  
back and forth between the two of them. I just wrote some code today on  
my  
desktop in which I invoked the #h method inside a controller (because I  
wanted to sanitize a string prior to saving it in an instance variable).  
When I got home this evening and pulled the code onto my laptop, I found  
that I got an undefined method error for h.

Why would it be undefined on one computer but not the other? The only  
thing  
that I can think of is that I (most likely) have different sets of gems  
installed (although both have rails 2.2.2 installed)

Any ideas?

–wpd
