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" , : 컨트롤러 => "trainerones"} – ubuseral
예, 불완전한 대답, 해결했습니다. – RadBrad