spree/spree — Issue #921: 404 on /states.js when Spree is mounted below root
Author: tomc-rs
Created: 2011-12-29 22:22:14+00:00
State: open

If Spree is mounted as an engine with a path other than root, the checkout edit page serves the wrong path to states.js, breaking the page logic.

core/app/views/spree/checkout/edit.html.erb looks like this:

```<% content_for :head do %>
<%= javascript_include_tag '/states' %>
<% end %>```

This hardcodes the path; in my app, where Spree is mounted at /store, this causes a 404 and breaks the page logic. Since this is a resourced controller, we can use url helpers like this:

```<% content_for :head do %>
<%= javascript_include_tag states_path %>
<% end %>```