Note that there are some explanatory texts on larger screens.

plurals
  1. PORails JQuery Missing template. Render Show action in Index
    primarykey
    data
    text
    <p>I have an rails app. I am starting to implement jquery functions within the app.</p> <p>I have a Project model which has many Milestones. I am trying to render a partial of the Show action of my Milestones, in the Index action using JQuery. Unfortunately, I am unable to do so, due to the following error in my JS console:</p> <pre><code>GET http://localhost:3000/projects/1/milestones/1 500 (Internal Server Error) Missing template milestones/show_milestone,application/show_milestone with {:locale=&gt;[:en], :formats=&gt;[:js, :html], :handlers=&gt;[:erb, :builder, :raw, :ruby, :jbuilder, :coffee]} </code></pre> <p><strong>Controller show action</strong></p> <pre><code>def show @milestone = Milestone.find(params[:id]) respond_to do |format| format.js {render :show_milestone} end end </code></pre> <p><strong>javascripts/milestones/show_milestone.js</strong></p> <pre><code>$(document).ready(function() { $(".milestone-content-area").html("&lt;%=escape_javascript( render( :partial =&gt; "milestones/show_milestone", :locals=&gt;{:@milestone=&gt;@milestone} ))%&gt;"); }); </code></pre> <p><strong>views/milestones/_show_milestone.html.erb</strong></p> <pre><code> &lt;%= @milestone.title %&gt; </code></pre> <p><strong>index.html.erb</strong></p> <pre><code>&lt;%= link_to milestone.title, project_milestone_path(@project, milestone), remote: true %&gt; &lt;div class="milestone-content-area"&gt; &lt;/div&gt; </code></pre> <p>I don't seem to understand what I am doing wrong. Thanks for reading!</p> <p>EDIT: I have added my link_to helper from my index.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload