我的Rails应用程序有一个单一的CustomerSelectionController,有两个动作:如何创建轨道控制器操作?
指数:其显示形式,其中用户可以输入客户信息和 选择:它只是显示一个静态页面。
class CustomerSelectionController < ApplicationController
def index
end
def select
end
end
我已经创建了我的routes.rb文件中的条目:
resources :customer_selection
在索引视图和形式如下:
<h1>Customer Selection</h1>
<%= form_tag("customer_selection/select", :method => "get") do %>
<%= submit_tag("Select") %>
<% end %>
但是当我点击在浏览器中选择按钮,我所得到的全部是:
未知动作
无法找到CustomerSelectionController的动作'show'
我不知道为什么它试图执行一个名为show的动作?我没有在任何地方定义或引用一个。
http://guides.rubyonrails.org/routing.html – gabrielhilal 2013-02-12 18:00:19
您是否将customer_selection/select路由到该方法? – TheDude 2013-02-12 18:01:21