Ask A Question

Notifications

You’re not receiving notifications from this thread.

Root route bypassing before_action

Peter vande Put asked in Rails

we have a posts_controller which takes a slug to render the correct page.
posts_controller inherits from application_controller which has a couple of before_actions

routes.rb has the following root

    root  'posts#show_post'

The before_actions are not called when going to localhost:3000 which renders the correct post.

also in the log i don't see the show_post action being called.
What am I missing here?

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 86,946+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.