-
Notifications
You must be signed in to change notification settings - Fork 41
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
URL with name instead of id #318
URL with name instead of id #318
Conversation
Just a thought - we might want to use this: http://guides.rubyonrails.org/routing.html#overriding-named-route-parameters so that we would have params[:name] instead of params[:id] |
@@ -206,10 +206,17 @@ def assign_show_view_vars | |||
|
|||
def set_organization | |||
@organization = Organization.find_by(slug: params[:organization_id]) | |||
fail ActiveRecord::RecordNotFound unless @organization |
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.
find_by! maybe?
…ad-of-id Conflicts: app/controllers/points_controller.rb app/controllers/solutions_controller.rb app/controllers/submissions_controller.rb app/models/course.rb app/views/exercises/show.html.erb app/views/submissions/_submission_details.html.erb config/routes.rb spec/controllers/points_controller_spec.rb
Resolved conflicts and tests pass. |
This doesn't preserve old URLs does it? This will almost certainly cause strange errors to users for a while after the update, until their clients refresh the course data. If we go ahead with this, the update should be done late at night IMO. |
Good point, I was already thinking on it: And without any changes on the server configuration this would most likely require all tmc-netbeans users to refresh the course list. |
Ah, good point. IMO requiring a course list refresh from each user is unacceptable. One option might be to patch the client to do this automatically if the course URL returns a 4xx. I'd really like to avoid more "temporary" server-side hacks if possible. |
Yea, we definitely should not break the behavior with our server side changes. :) I'v suggested adding this behavior to tmc-core testmycode/tmc-core#39 |
I feel that it might just make more sense to keep on supporting our current routing schemes for a while; thus we should continue working on this to allow both kind of urls to be used for routing. |
c8fc4d0
to
2d7423c
Compare
dcd24ed
to
d5cd6cb
Compare
This pull request changes course id to course name in URL. Same thing is done also for exercise.
Security hole is removed by introducing check for URL parameters so that teachers from one organization can't do changes to courses in other organization.