# N00B Question: How to access methods in a helper?

**URL:** <https://www.ruby-forum.com/t/n00b-question-how-to-access-methods-in-a-helper/49804>\
**Category:** Rails\
**Created:** [December 8, 2005, 9:30pm UTC](https://www.ruby-forum.com/t/n00b-question-how-to-access-methods-in-a-helper/49804 "2005-12-08T21:30:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mariano.kamp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9de053/32.png) [@mariano.kamp](https://www.ruby-forum.com/u/mariano.kamp)\
**Post date:** [December 8, 2005, 9:30pm UTC](https://www.ruby-forum.com/t/n00b-question-how-to-access-methods-in-a-helper/49804/1 "2005-12-08T21:30:07Z")

</div>

Hi,

I always get the following error when trying to access a helper  
method.

–\> undefined method `some\_helper\_method’ for  
#BlogController:0x2706fec

blog\_controller.rb:  
class BlogController \< ApplicationController  
def index  
render(:text =\> some\_helper\_method(“x”))  
end  
end

blog\_helper.rb:  
module BlogHelper  
def some\_helper\_method(text)  
text+="!!!"  
end  
end

(Structure came from script/generate controller Blog)

On a sidebar … What I was actually trying is to use textilize, but  
also  
got the same error message. Installing redcloth as gem didn’t help,  
neither  
adding require\_gem “RedCloth” to environment.rb.

???

Any idea what I do wrong?

Cheers,  
Mariano

---

<div class="post-metadata">

**Author:** ![mariano.kamp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9de053/32.png) [@mariano.kamp](https://www.ruby-forum.com/u/mariano.kamp)\
**Post date:** [December 8, 2005, 9:38pm UTC](https://www.ruby-forum.com/t/n00b-question-how-to-access-methods-in-a-helper/49804/2 "2005-12-08T21:38:20Z")

</div>

> blog\_controller.rb:  
> class BlogController \< ApplicationController  
> def index  
> render(:text =\> some\_helper\_method(“x”))  
> end  
> end

Helpers are not available in controllers. Try this instead:

def index  
render :inline =\> “\<%= some\_helper\_method(‘x’) %\>”  
end

–  
rick  
[http://techno-weenie.net](http://techno-weenie.net)

---

<div class="post-metadata">

**Author:** ![mariano.kamp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9de053/32.png) [@mariano.kamp](https://www.ruby-forum.com/u/mariano.kamp)\
**Post date:** [December 9, 2005, 6:31am UTC](https://www.ruby-forum.com/t/n00b-question-how-to-access-methods-in-a-helper/49804/3 "2005-12-09T06:31:37Z")

</div>

Rick O. wrote:

> def index  
> render :inline =\> “\<%= some\_helper\_method(‘x’) %\>”  
> end

Another possibility is:

def index  
render\_text(@template.some\_helper\_method(“x”))  
end

More efficient too. But it will not work for helpers that require the  
full view context to run.

– stefan

[http://railsexpress.de/blog](http://railsexpress.de/blog)
