user508546
user508546

Reputation: 441

How to configure routes.rb to route any action

I'm tired of creating a new line in my routes.rb every time I add a new method in my controller. Is there a way in routes.rb to tell rails to accept any defined action in a given controller? I'm pretty sure I've done this before but can't remember how. I still need to explicitly specify the controller, however, because many other people use this routes file.

Thanks!

Upvotes: 0

Views: 499

Answers (1)

cpjolicoeur
cpjolicoeur

Reputation: 13106

This is from the default generated config/routes.rb file

# This is a legacy wild controller route that's not recommended for RESTful applications.
# Note: This route will make all actions in every controller accessible via GET requests.
# match ':controller(/:action(/:id(.:format)))'

Upvotes: 2

Related Questions