-
Notifications
You must be signed in to change notification settings - Fork 523
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
AO3-3471 Filter works per language on language_works_path #4659
Conversation
At least once outside the url
Summarising conversation from elsewhere: we do hardcode 404 the path for efficiency reasons. In particular
show redirect to the /language/:short/works path (we'll need to check admin edits work as normal though).
|
@brianjaustin Is this ready to merge or action is still needed? |
Updated it to return to the index /languages, since that was already what the create route was doing. |
resources :languages do | ||
resources :languages, except: [:show] do | ||
resources :works | ||
resources :admin_posts | ||
end | ||
get "/languages/:id", to: redirect("/languages/%{id}/works", status: 302) |
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 think it would be more obvious that this route belongs to languages
if we use the member
block like
resources :languages do | |
resources :languages, except: [:show] do | |
resources :works | |
resources :admin_posts | |
end | |
get "/languages/:id", to: redirect("/languages/%{id}/works", status: 302) | |
resources :languages, except: [:show] do | |
resources :works | |
resources :admin_posts | |
member do | |
get :show, to: redirect("/languages/%{id}/works", status: 302) | |
end | |
end |
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.
Doesn't appear to work. Or more exactly, it works too well, changing all get routes on /languages to a redirect.
I would say the get "/languages/:id", to:
is good enough as is? It's consistent with official documentation.
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.
Oh no, definitely don't want that! I'm definitely good with your version over a version that breaks other things 😂
This reverts commit 3af690d.
Pull Request Checklist
AO3-1234 Fix thing
)Issue
https://otwarchive.atlassian.net/browse/AO3-3471
Purpose
Filter per language using ElasticSearch; same general behavior as filtering using a tag
Testing Instructions
Go to
/languages/en/works
,/languages/de/works
,/languages/fr/works
, etc.Check the works shown are indeed in the selected language
Note: These routes are currently disabled on staging and production, and I'm not exactly sure how. nginx configuration?
Credit
Ceithir (he/him)