Rails Rails 中表单提交的 URL 的路径问题

sunsonavaj · May 08, 2012 · Last by sunsonavaj replied at May 11, 2012 · 3362 hits

path 是相对路径 url 是绝对路径 model 为复数的会对应到 action=>index, 为单数时需要传递 id 参数并对应到 action=>show 如对于 user 而言: users_url # => http://localhost:3000/users users_path # => /users user_path(1) # => /users/1 user_url(1) # => http://localhost:3000/users/1

这些都是 GET 方法的,form 表单一般是 POST,PUT. 可以在终端$ rake routes 查看所有路由

这篇帖子的目的是?@sunsonavaj

目的想学习一下看看是否还有其他的方法,因为最近部署一个项目查了好久才知道是这个问题

You need to Sign in before reply, if you don't have an account, please Sign up first.