When I call the index action of my assets controller, the corresponding index template uses the assets layout which includes this line:
<%= javascript_include_tag 'prototype' %>
The error I get is:
No route matches "/javascripts/prototype.js" with {:method=>:get}
This is my routes file:
ActionController::Routing::Routes.draw do |map|
map.resources :assets
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'
end
Any idea what I could be missing here?
Is there a way to explicity define a route for this file?
You shouldn’t need to define a route for this – it should be handled by the rewrite rules in your .htaccess file.
You need to check that your mod_rewrite is enabled, and that the .htaccess file is correct – it should be sending the request to your dispatch.rb only if the requested file does not exist in your public directory. You may also need to check that the file exists.