I had a working application when I went to bed, and when I booted it back up this morning, the AJAX no longer seemed to work, and remote:true does not seem to do anything. I have spent most of the day trying answers to related questions to no avail.
In categories/index.html.erb (set as root), I link to the SHOW request for each category, and the container for the result, referenced in categories/show.js.erb
<% @categories.each do |category| %>
- <%= link_to category.name, category, remote: true %><% end %>This should load the contents of category/_show.html.erb
$('#somevehicles').html("<%= j render 'categories/show', category: @category %>")
<% @category.vehicles.each do |p| %> <%= p.name %> <% end %>
class CategoriesController < ApplicationController before_action :set_category, only: [:show, :edit, :update, :destroy] . . . def show end . . .
When I run the rails server in dev i recieve no errors. Instead, when I click on the rendered
<%= link_to category.name, category, remote: true %>, it takes me to show.html.erb(no underscore), which is where it would go if there were no
remote:true at all. Before, even without complete AJAX or a corresponding .js.erb, adding
remote:true to the tag made it so the link went nowhere, so I'm stuck.