开发者

How to configure routes.rb to route any action

开发者 https://www.devze.com 2023-03-30 23:51 出处:网络
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 pre

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!


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)))'
0

精彩评论

暂无评论...
验证码 换一张
取 消