params comes from three sources
- URL
- Request String (GET)
- Frequently Published Form Data Submit (POST)
The controller name and action name come from the URL. Say the URL is "article / 123", Rails will know:
ArticlesController - because the "article" is the first part of the URL#show action, because the GET request is the identifier
Any controller and action can be recognized after you define them in routes.rb . Remember, you need to assign a controller name and action for a custom route?
source share