title: Call ruby method from JavaScript or pass parametr from view in RoR
body: <p>I have view with list of websites. Details about websites are shown in retracted mode.<p> I need to show appropriate website details, when user clicks on some image.
  <p>I was using this post : <a href="https://stackoverflow.com/questions/8272147/passing-parameters-to-from-javascript-rails">Passing parameters to/from JavaScript &amp; Rails</a>
  <p>Here is my code from view:</p>
  
  <pre><code> &lt;table&gt;
     &lt;% @websites.each do |website| %&gt;
    &lt;%if (current_user.id == website.user_id)%&gt;
    &lt;tr&gt;
      &lt;td&gt;  &lt;%= link_to(image_tag("/images/caret-horizontal.png",website_path(website)) %&gt; &lt;/td&gt;
  &lt;td&gt;  
  &lt;h4&gt;&lt;%= website.name %&gt;&lt;/h4&gt; &lt;/td&gt;
  
   &lt;/tr&gt;
   &lt;table id="&lt;%= website.id %&gt;"&gt;
   &lt;tr &gt;
     &lt;td &gt;
    &lt;td &gt;
    &lt;%= website.url %&gt;
    &lt;/td&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
   &lt;tr id="&lt;%= website.id %&gt;"&gt;
  &lt;td &gt;
  &lt;td &gt;
  &lt;%= website.category  %&gt;
  &lt;/td&gt;
  &lt;/td&gt;
   &lt;/tr&gt;
   &lt;tr id="&lt;%= website.id %&gt;"&gt;
   &lt;td&gt;
  &lt;td&gt;&lt;%= website.language %&gt;&lt;/td&gt;
   &lt;/td&gt;
  </code></pre>
  
  <p>
     </p>
  
  <pre><code>&lt;%end%&gt;
  
   &lt;%end%&gt;
   &lt;/table&gt;
  </code></pre>
  
  <p>And code in application.js:</p>
  
  <pre><code>   $("#table").show();//here I need something like var table = &lt;%= website.id%&gt;
  </code></pre>
  
  <p>How I should choose appropriate website id?
  <p>or I should transmit website.id in data ?
  <p>How I can do it another way ?</p>