这是我的控制器:
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
这是我的 new.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