-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explicitly define backend/promotions routes #2332
Explicitly define backend/promotions routes #2332
Conversation
6f2b481
to
49ff218
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, left a comment to improve how to exclude a single route from resources
.
backend/config/routes.rb
Outdated
@@ -9,7 +9,7 @@ | |||
end | |||
end | |||
|
|||
resources :promotions do | |||
resources :promotions, only: [:new, :edit, :update, :create, :destroy,] do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd write except: :show
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed it 👍
9d394c8
to
49e4558
Compare
Thinking twice, it's probably better to redirect to the |
this has been the best redirect ever, as I can relatively easy add In the promotions, I don't think it matters much. |
The thing I was thinking at is that by only removing the |
49e4558
to
0f936fd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
@vladstoick thanks! |
Currently the
show
route is also include but it's never defined which leads to aAbstractController::ActionNotFound
being thrown in case someone reachesthat page