democracyworks / hat-trick

Hat Trick - Rails wizards done right
MIT License
5 stars 0 forks source link

Handle non-root URLs correctly in pushState #5

Closed cap10morgan closed 12 years ago

cap10morgan commented 12 years ago

When pushing a new step URL w/ pushState, take into account that the wizard might not be rooted at the site root.

Hat-Trick should look for the last path element of the URL ("baz" in "http://host.com/foo/bar/baz") and then check to see if that matches the current step's name. If it does, replace it with the next step's name. If it does not, append the next step's name to it.

This will help the pushState URLs also work when they get sent to the server.

cap10morgan commented 12 years ago

Fixed by 38b2c72489518cd29ec72c74629882ef1e467084.