title: How to include my own Ruby (on rails) functions inside an HTML page
body: <p>I'm creating a web-app. 
  While it works great, writing whole pieces of code inside "&lt;% %>" tags in ruby on rails is pretty ugly.</p>
  
  <p>I tried to define a function in my controller.rb and then call it from the html page.
  This does not work, as it does not recognize the function.</p>
  
  <p>I'd appreciate any help here. Did I put my function in the correct place? Do I need to load using "require"?</p>
  
  <p>For example:</p>
  
  <p><strong>controller file:</strong></p>
  
  <pre><code>class WelcomeController &lt; ApplicationController
   def index
   end
   def myfunc(x)
    puts x
   end
  end
  </code></pre>
  
  <p><strong>HTML file (index.html):</strong></p>
  
  <pre><code>&lt;h1&gt;Welcome&lt;/h1&gt;
  &lt;p&gt;
  &lt;%= myfunc(5) %&gt;
  &lt;/p&gt;
  </code></pre>