title: Rails 3 form_for ajax call
body: <p>I have method in my controller:</p>
  
  <pre><code>def work_here
   @company = Company.find(params[:id])
   current_user.work_apply(current_user, @company)
   redirect_to company_path
  end
  </code></pre>
  
  <p>On my view:</p>
  
  <pre><code>&lt;%= render 'companies/work_form' if signed_in? %&gt;
  </code></pre>
  
  <p>_work_form.html.erb:</p>
  
  <pre><code>&lt;%= form_for company, :remote =&gt; true, :url =&gt; { :controller =&gt; "companies", :action =&gt; "work_here" } do |f| %&gt;
  &lt;%= f.hidden_field :id, :value =&gt; company.id %&gt;
  &lt;%= f.submit "I working here" %&gt;
  </code></pre>
  
  <p>&lt;% end %></p>
  
  <p>And I have a work_here.js.erb file:</p>
  
  <pre><code>$("#work_at_form").html("&lt;%= escape_javascript("render('companies/works')") %&gt;")
  </code></pre>
  
  <p>But my form works without ajax request(in other pages ajax forks fine), my js.erb file never use.
  Can anyone give me advise?
  Thanks.</p>