【发布时间】:2011-04-13 08:10:39
【问题描述】:
我已经创建了模型、视图和控制器:
$ rails generate scaffold Post name:string title:string content:text
我运行服务器,如果我在浏览器中打开 http:\localhost:3000\posts,我会看到帖子列表。 现在我需要创建指向此页面的链接。比如:
<%= link_to("settings", { :controller => 'groups', :action => 'index'}) %>
但打开此页面时出现错误:
Couldn't find Group with ID=index
如何创建指向 http:\localhost:3000\posts 的链接,在这种情况下我应该使用哪个操作?
【问题讨论】:
标签: ruby-on-rails