Closed ragesoss closed 2 years ago
Hello @ragesoss I would like to work on this issue, I will start the research
@enelesmai how is it going? Give me a ping if you need any help.
Hi @ragesoss I will like to work on this if it's still available.
Hi @ragesoss I am having a tough time figuring this out. Any clue?
@buildwithallan sure. can you summarize what you've researched and what ideas you have so far?
@ragesoss Okay. I read that if you want to support a url parameter more complex than an id number, you may run into trouble with the parser if the value contains a period. Anything following a period will be assumed to be a format(i.e. json)
If you want to support a url parameter more complex than an id number, you may run into trouble with the parser if the value contains a period. Anything following a period will be assumed to be a format (i.e. json, xml). For it to work, you will have to add a constraint to broaden the accepted input.
Example: resources :users, constraints: { id: /.*/ }
Good, it sounds like you are on the right track. A good next step would be to write some tests for the examples in this issue. Doing that may help you pin down which route lacks the constraints
it needs to work in this situation.
You can see that we already use this constraints: { id: /.*/ }
approach for many routes in routes.rb
, so it might be easy to fix once you find the correct route.
@ragesoss Sure I will do that.
initially :
get 'courses/:school/:titleterm(/:_subpage(/:_subsubpage(/:_subsubsubpage)))' => 'courses#show',
:as => 'show',
constraints: {
school: /[^\/]*/,
titleterm: /[^\/]*/
}
mysuggestion :
get 'courses/:school/:titleterm(/:_subpage(/:_subsubpage(/:_subsubsubpage)))' => 'courses#show',
:as => 'show',
constraints: {
school: /[^\/]*/,
titleterm: /[^\/]*/,
_subsubsubpage: /.*/
}
update :
+ _subsubsubpage: /.*/
➡️ @ragesoss is it make sense?
Something like that is what I was thinking, yes. Did you test it out?
I am currently working on this issue @zishugshan please
👍 sure, you do this. @buildwithallan I am sorry, I thought you are not active for someday
The server returns a 404 for this URL: https://dashboard.wikiedu.org/courses/University_of_Ottawa/CMN2160C_(Winter)/students/articles/Heba.Aweiwi
Other usernames in the same course work fine: https://dashboard.wikiedu.org/courses/University_of_Ottawa/CMN2160C_(Winter)/students/articles/Nabila%20Bashamuher
Navigating to that user from an already-loaded course page (such as the second link) also work fine, so the problem is likely with the Rails route.