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
#resource
and #resources
fail quietly and succeed quietly when invalid arguments are passed to :only
and :except
options respectively
#51463
Comments
joshuay03
added a commit
to joshuay03/rails
that referenced
this issue
Apr 2, 2024
…ons are given to #resource or #resouces
4 tasks
joshuay03
added a commit
to joshuay03/rails
that referenced
this issue
Apr 2, 2024
…ons are given to `#resource` or `#resouces`
joshuay03
added a commit
to joshuay03/rails
that referenced
this issue
Apr 2, 2024
…ons are given to `#resource` or `#resouces`
joshuay03
added a commit
to joshuay03/rails
that referenced
this issue
Apr 2, 2024
…ons are given to `#resource` or `#resouces`
joshuay03
added a commit
to joshuay03/rails
that referenced
this issue
Apr 2, 2024
…ons are given to `#resource` or `#resouces`
joshuay03
added a commit
to joshuay03/rails
that referenced
this issue
Apr 2, 2024
…ons are given to `#resource` or `#resources`
joshuay03
added a commit
to joshuay03/rails
that referenced
this issue
Apr 2, 2024
…ons are given to `#resource` or `#resources`
joshuay03
added a commit
to joshuay03/rails
that referenced
this issue
Apr 2, 2024
…ons are given to `#resource` or `#resources`
joshuay03
added a commit
to joshuay03/rails
that referenced
this issue
Apr 2, 2024
…ons are given to `#resource` or `#resources`
joshuay03
changed the title
Apr 2, 2024
#resource
and #resources
fail quietly and succeed quietly when invalid arguments are passed to :only
end :except
options respectively#resource
and #resources
fail quietly and succeed quietly when invalid arguments are passed to :only
and :except
options respectively
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This came up when pairing with a dev who is newish to Rails. They assumed that passing a custom action argument to
:only
when using#resources
would auto-magically define a route for it with some defaults. Reading the examples in the documentation for these methods, it's not clear (especially to beginners) what all the accepted arguments for these options are, there are only examples using default actions.I think it would be beneficial if an error was raised if invalid arguments are passed in.
Steps to reproduce
Expected behavior
Passing invalid options to
:only
or:except
should raise an error with an informative message.Actual behavior
Passing invalid options to
:only
fails quietly and no routes are generated.Passing invalid arguments to
:except
succeeds quietly and all default routes are generated (index, create, new, show, update, and destroy).System configuration
Rails version: Edge
Ruby version: 3.3.0
The text was updated successfully, but these errors were encountered: