2
|
nonopolarity · 技术社区 · 15 年前 |
![]() |
1
1
可以使用:requirements对要匹配的路由:id施加一些条件,例如:map.connect“:controller/:action/:id”,:requirements=>:id=>/\d 4/。这样,如果:id不符合要求,那么路由也将不匹配。 |
![]() |
2
0
在控制器中,如果
|
![]() |
3
0
http://localhost:3000/foobars/alt 要实现此路径,您必须在routes.rb中提到此路径。 有点像跟踪
否则,它将把alt视为参数[:id],如果使用scaffolding创建控制器,它将转到
|
![]() |
cluster1 · 采取独立的新行动的好处是什么? 9 月前 |
|
Robert · 使用JSON或哈希时,将NULL替换为NIL 10 月前 |
![]() |
Fred Willmore · Rails控制器不呈现任何模板 1 年前 |
![]() |
Diogo Amaral · 实现API请求的正确方式 1 年前 |
![]() |
Meknassih · 在控制器方法中分配给模型没有任何作用 1 年前 |
![]() |
Michael Ding · Rails上的默认会话到期问题 1 年前 |
|
Flávio · 基于另外两个生成数组 1 年前 |