title: How to call method of the controller to the view in rails?
body: <p>In controller</p>
  
  <pre><code>def test
    command = 'pwd'
    result = `#{command}`
  
     respond_to do |format| 
       format.html { redirect_to(users_url) } 
       format.js { render :text =&gt; "$('#teste').html('#{result}');" } 
     end 
  end
  </code></pre>
  
  <p>I want to show the variable result</p>
  
  <p>In view</p>
  
  <pre><code>&lt;%= link_to 'Testar', test_users_path, :method =&gt; :get, :remote =&gt; true  %&gt; 
  </code></pre>