0
我想发送一个参数“Sportler”给我的新动作,那里我想创建一个这种类型的新对象。动作参数
您可以在下面看到错误消息。
查看:
<%= link_to 'New Sportsmen', :action => "new(:type => "Sportler")" %>
控制器:trainerones
def new
@trainerones = Person.new(:type => params[:type])
respond_to do |format|
format.html # new.html.erb
format.json { render json: @trainerones }
end
我得到这个:
G:/testmud/app/views/trainerones/show.html.erb:27: syntax error, unexpected tCONSTANT, expecting ')'
...ler', :action => "new("Sportler")");@output_buffer.safe_con..
而且动作不调用与new_trainerones_path,我在哪里可以注册这个帮手?
现在即时通讯使用新的。
为此我说:比赛 'trainerones /新'=> 'trainerones#新'
听起来不错,没有路由匹配{:动作=> “?新型= Sportler” ,:controller =>“trainerones”} – ubuseral 2013-02-20 22:11:10
是的,不完整的答案,我修正了它 – RadBrad 2013-02-20 22:18:54