-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Improve Errors when Controller Name or Action isn't specfied #12740
Conversation
Hello, Thanks for your patch! 👍 Maybe we could add a test case for this ? Also, can you add a changelog entry please ? |
I don't like the idea of giving links for guides for these errors. Also these guides are dependent on versions. So in every release we need to change URLS here? |
I dont think this needs a changelog/test. On Saturday, November 2, 2013, Gaurish Sharma wrote:
Vipul A.M. |
end | ||
|
||
if action.blank? && segment_keys.exclude?(:action) | ||
raise ArgumentError, "missing :action" | ||
message = "Error missing :action key from params. possibly, action isn't correctly specified. check your routes" | ||
raise ArgumentError, message | ||
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.
Can you make the messages look like the same? How about this:
Missing :controller key on routes definition, please check your routes.
Yes, you are right guys, sorry! |
These errors occur when, there routes are wrongly defined. example, the following line would cause a missing :action error root "welcomeindex" Mostly beginners are expected to hit these errors, so lets improve the error message a bit to make their learning experience bit better.
@carlosantoniodasilva |
Does this really needs to assign variables? |
@dmathieu Not really. use of variable make this code easy to read & also this pattern is used throughout the file. Any reason NOT to use variables here? |
Improve Errors when Controller Name or Action isn't specfied
Improve Errors when Controller Name or Action isn't specfied
These errors occur when, there routes are wrongly defined.
example, the following lines would cause a missing :action error
Mostly beginners are expected to hit these errors, so lets improve the error message a bit to make their learning experience bit better.