I've added JavaScript partials many times before, but admittedly not for a while. The short of it is, I'm missing something stupid.
When I try to render partial 'deleteme.js' at the end of this view:
/app/views/projects/myview.html.slim:
h2 Stuff goes here
render partial: '/projects/thisworks' # Render html partial
render partial: '/projects/deleteme.js' # Render js partial...fails
Which renders this partial:
/app/views/projects/_deleteme.js.erb:
console.log("Oh FFS, Work");
I get:
ActionView::MissingTemplate in Projects#show
Showing /Users/aj/Web/Rails/sh3/app/views/projects/show.html.slim where line #5 raised:
Missing partial /projects/deleteme with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :slim, :jbuilder, :coffee, :haml]}. Searched in: * ...
The incriminating bit is that it's searching for formats => [:html] only, but I thought appending .js automatically tells rails to search for javascript. If anyone has any ideas as to why it's not finding the JS template, I'd be really appreciative. Action code is a very basic:
def show
@project = Project.find(params[:id])
end