我是Ruby on Rails的初学者。我有一个users_controller.rb
有大约action
大约100多。所以很难在路由器中设置。我想自动设置操作。如何在CakePHP中像ruby一样自动获取页面URL?
例子:
def abc
render text: 'Hello World!'
end
...
...
def xyz
render text: 'Bla Bla Bla'
end
我希望我的网址应该是开放的这种类型的
http://localhost:3000/users/abc
http://localhost:3000/users/xyz
http://localhost:3000/users/some-action..
无需设置路由器任何多行URL路径。
下面我写了路由器。卜代码不工作:
match ':controller(/:action(/:id(.:format)))'
请帮我
你需要这种类型的应用程序中的所有控制器的东西?或一个特定的控制器 – Thorin
我认为你不应该使用这种类型的东西http://homakov.blogspot.in/2012/04/whitelist-your-routes-match-is-evil.html – Thorin
什么是'dnd'? ...... – sawa