BigW Consortium Gitlab
================== = Implementation = ================== 1. The path of the page is of the form 'group/project/pages/domains/<domain_name>' 2. Rails looks at `params[:id]` (which should be the domain name), and finds the relevant model record. 3. Given a domain like `foo.bar`, Rails sets `params[:id]` to `foo` (should be `foo.bar`), and sets `params[:format]` to `bar` 4. This commit fixes the issue by adding a route constraint, so that `params[:id]` is set to the entire `foo.bar` domain name. ========= = Tests = ========= 1. Add controller specs for the `PagesDomainController`. These are slightly orthogonal to this bug fix (they don't fail when this bug is present), but should be present nonetheless. 2. Add routing specs that catch this bug (by asserting that the `id` param is passed as expected when it contains a domain name). 3. Modify the 'RESTful project resources' routing spec shared example to accomodate controllers where the controller path (such as `pages/domains`) is different from the controller name (such as `pages_domains`).
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
environments | Loading commit data... | |
initializers | Loading commit data... | |
locales | Loading commit data... | |
routes | Loading commit data... | |
README.md | Loading commit data... | |
application.rb | Loading commit data... | |
aws.yml.example | Loading commit data... | |
boot.rb | Loading commit data... | |
database.yml.env | Loading commit data... | |
database.yml.mysql | Loading commit data... | |
database.yml.postgresql | Loading commit data... | |
dependency_decisions.yml | Loading commit data... | |
environment.rb | Loading commit data... | |
gitlab.yml.example | Loading commit data... | |
license_finder.yml | Loading commit data... | |
mail_room.yml | Loading commit data... | |
newrelic.yml | Loading commit data... | |
no_todos_messages.yml | Loading commit data... | |
resque.yml.example | Loading commit data... | |
routes.rb | Loading commit data... | |
secrets.yml.example | Loading commit data... | |
sidekiq.yml.example | Loading commit data... | |
sidekiq_queues.yml | Loading commit data... | |
unicorn.rb.example | Loading commit data... | |
unicorn.rb.example.development | Loading commit data... |