【发布时间】:2014-06-07 11:36:08
【问题描述】:
我有一个使用身份验证的博客,用户可以在其中创建帖子我的帖子是通过脚手架生成的,并且希望用户在想要编辑帖子时将他们重定向到类似 localhost:3000/posts/jack-stone 的内容/the-first-post/edit 而不是 localhost:3000/posts/the-first-post/edit (jack-stone 是用户全名,the-first-post 是帖子标题(我使用 FriendlyId gem这))我怎样才能做到这一点?我的实际发帖路线是resources :posts
【问题讨论】:
标签: ruby-on-rails ruby routes friendly-url