Skip to content

before block called in subclass invoked in parent class #1880

Answered by dentarg
jedrekdomanski asked this question in Q&A
Discussion options

You must be logged in to vote

You don't want to use ArticlesController as a middleware, that's why your before filter runs for every request.

Here's how you separate them (remove articles from the routes in ArticlesController)

map '/' do
  run ApplicationController
end

map '/articles' do
  run ArticlesController
end

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@jedrekdomanski
Comment options

Answer selected by jedrekdomanski
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1879 on February 19, 2023 17:25.