In my app, there's a seperate admin area to control everything including writing posts. The post routes point inside the admin panel :
resources :posts, path: '/admindashboard/posts'
Now in the normal view, Im trying to display the posts inside the pages controller under the blog action. I have managed to list the posts in the blog. But linking to them and showing individual posts is the problem.
Not : I use a post slug instead of the id.
If I link to the post like this :
<%= link_to post.title, post %>
It will go to /admindashboard/posts/post-slug. But to access that url, we need to sign in. I need to put it like /blog/post-slug . How to do it? How to add the right action in the pages controller to display individual post pages?