# Haml view can't find helper function

**URL:** <https://www.ruby-forum.com/t/haml-view-cant-find-helper-function/193013>\
**Category:** Ruby\
**Created:** [August 10, 2010, 1:22am UTC](https://www.ruby-forum.com/t/haml-view-cant-find-helper-function/193013 "2010-08-10T01:22:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rainyglade](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/cab0a1/32.png) [@rainyglade](https://www.ruby-forum.com/u/rainyglade)\
**Post date:** [August 10, 2010, 1:22am UTC](https://www.ruby-forum.com/t/haml-view-cant-find-helper-function/193013/1 "2010-08-10T01:22:23Z")

</div>

I have an object called Survey. There is a haml file:  
\views\surveys\index.html.haml.

The last line of the file is:

= render :partial =\> ‘parameter\_results’, :locals =\>{:options =\>  
chart\_options(:n, :age)

chart\_options is in surveys\_helper.rb. The error I’m getting is:

undefined method ‘chart\_options’ for #ActionView::Base:0x4603a28

What gives? I thought the helper functions were always available to the  
view. Or is there something wrong with my haml statement?

Thanks in advance.  
LG

---

<div class="post-metadata">

**Author:** ![rainyglade](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/cab0a1/32.png) [@rainyglade](https://www.ruby-forum.com/u/rainyglade)\
**Post date:** [August 10, 2010, 1:57am UTC](https://www.ruby-forum.com/t/haml-view-cant-find-helper-function/193013/2 "2010-08-10T01:57:01Z")

</div>

Louise R. wrote:

> I have an object called Survey. There is a haml file:  
> \views\surveys\index.html.haml.
> 
> The last line of the file is:
> 
> = render :partial =\> ‘parameter\_results’, :locals =\>{:options =\>  
> chart\_options(:n, :age)}
> 
> chart\_options is in surveys\_helper.rb. The error I’m getting is:
> 
> undefined method ‘chart\_options’ for #ActionView::Base:0x4603a28
> 
> What gives? I thought the helper functions were always available to the  
> view. Or is there something wrong with my haml statement?
> 
> Thanks in advance.  
> LG

There was a report function called by chart\_options that was in the  
helper. I moved it into the model and I’m now getting past that error.
