You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on adding Spina to an existing Rails 6 project, Spina v1.2.0 (loving it so far!), and with the following mounting path defined in routes.rb:
`mount Spina::Engine => '/blog'`
Things are mostly working great: I'm able to create pages in the Admin interface, I can access http://localhost:3000/blog to see a nav menu/list of my pages, and I can navigate directly to a page url by manually entering the url (e.g. http://localhost:3000/blog/testing).
What I can't figure out is that the blog homepage nav list links aren't respecting the engine mounting path: given a page with the title "testing", when I click on the nav list link (see screenshot at bottom), it navigate to localhost:3000/testing and notlocalhost:3000/blog/testing as I would expect.
Keep in mind that when pages are saved, the URLs are stored in the database as "materialized paths". Changing Spina's mount path means you have to regenerate all materialized paths. You can do that by calling .save on each page.
Would anyone take pity on me and walk me through this or suggest a different approach to get these paths to honor mounting path?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey all,
I'm working on adding Spina to an existing Rails 6 project, Spina v1.2.0 (loving it so far!), and with the following mounting path defined in
routes.rb
:Things are mostly working great: I'm able to create pages in the Admin interface, I can access
http://localhost:3000/blog
to see a nav menu/list of my pages, and I can navigate directly to a page url by manually entering the url (e.g.http://localhost:3000/blog/testing
).What I can't figure out is that the blog homepage nav list links aren't respecting the engine mounting path: given a page with the title "testing", when I click on the nav list link (see screenshot at bottom), it navigate to
localhost:3000/testing
and notlocalhost:3000/blog/testing
as I would expect.Docs here mention:
Would anyone take pity on me and walk me through this or suggest a different approach to get these paths to honor mounting path?
tyty, G
Beta Was this translation helpful? Give feedback.
All reactions