这是我的控制者:
class ReportNeedsController < ApplicationController
def index
@report_needs = nil
end
def new
@report_need = ReportNeed.new
end
def create
@report_need = ReportNeed.new(params[:report_need])
@report_need.save
redirect_to @report_need
end
end
这是我的新的。 haml档案:
为什么要报告?
%form
%input{:name => "option", :type => "radio", :value => "spam"}
spam
%br/
enter code here
%input{:name => "option", :type => "radio", :value => "product_corrupted"}
product_corrupted
%br/
%input{:name => "option", :type => "radio", :value => "product_spoiled"}
product_spoiled