title: Can I create a ViewHelper for a javascript-block?
body: <p>I'm cleaning up my code of my Rails-app. I'm using the <code>Raty-gem</code> for my rating system. To render a <code>#average_rating</code> I'm using a script-block (picked this up in some tutorial) in the specific views. But since I'm using the <code>#average_rating</code> in over 6 different views, I was hoping that I could do this more efficient. I already tried to use a HelperMethod for it, but i guess that it doesn't accept 'javascript'.</p>
  
  <p><strong>Script-block:</strong></p>
  
  <pre><code>&lt;script&gt;
  $('#average_rating').raty({
      path: '',
      readOnly: true,
      score: &lt;%= @project.average_rating %&gt;
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>What is the cleanest way of doing this in Rails?</p>