-
Notifications
You must be signed in to change notification settings - Fork 0
two-first-end-points #1
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
base: main
Are you sure you want to change the base?
Conversation
| player.user_id = i[:userId] | ||
| player.correct_questions = i[:correctQuestions] | ||
| player.incorrent_questions = i[:incorrectQuestions] | ||
| player.tournament_id = tournament.tournament_id |
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.
This is very confusing - the Rails convention would be that player.tournament_id would hold tournament.id, not tournament.tournament_id
That's how ActiveRecord knows how to find it in the DB with the belongs_to relation
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.
no sure I got you.
| class TournamentsController < ApplicationController | ||
| skip_before_action :verify_authenticity_token | ||
|
|
||
| def saveTournamentResults |
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.
Always use snake_case - same goes for all of the other endpoints
| def saveTournamentResults | |
| def save_tournament_results |
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.
how its can be?
how you can config a route with snake_case? there is a way to configure route as usual and route it to the controller with snake_case?
No description provided.