Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Bad routes problems #108

Closed
theCrab opened this Issue · 12 comments

4 participants

@theCrab

I am using the spree_static_content 1.3.2-stable branch.
I have my Spree mounted at '/store'

Now I get urls like http://localhost:3000/storeabout-us instead of http://localhost:3000/about-us

What am I doing wrong?

@JDutil
Owner

What is the url/path helper code being used in your template?

@theCrab

i have none. Should I be using one?

@theCrab

@jdutil could you please explain the url/helper requirement. I don't understand it.

Thanks

@theCrab

@jdutil is the helper the main_app.*_path

@JDutil
Owner

Yes which should be spree.*_path for spree routes. You will need to provide a more detailed description of the actual code being used such as your template in order to help any further.

@theCrab

@jdutil Problem is this: If I mount Spree ... at: '/' the pages work fine. But not if the setup looks like below

  root :to => 'welcome#index'

  mount Spree::Core::Engine, :at => '/store'

I get URL's like

http://localhost:3000/storeabout-us

But I want

http://localhost:3000/store/about-us

or 
http://localhost:3000/about-us
@theCrab

so my question is: Where is spree_static_content routes mounted? It looks like on the Spree namespace. Why is it not working?

@msevestre
@theCrab

it doesn't work unfortunately doesn't work @msevestre

@JDutil
Owner

I haven't used this extension with a mount other than '/' so I'm not sure what the underlying problem is.

What happens if you ensure your pages have a leading / in the slug? For instance if your slug is 'about-us' try '/about-us'.

@JDutil
Owner

As part of #98 we discussed forcing all slugs to contain the leading / so if it's required to fix this bug than probably will go forward with that.

@theCrab

rake routes produces something interesting

root               /
spree            /
static GET    /                              spree/static_content#show
static GET    /*path(.:format)         spree/static_content#show

@jdutil and yes adding a leading '/*' in the slug it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.