これは私のコントローラーです:
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