-2
このエラーをどのようにするには?レールでのルーティングエラー
[POST] "/ controller/controller id/controller/new"と一致するルートはありません。
//ドクターコントローラー:
# POST /doctors
# POST /doctors.json
def create
@doctor = Doctor.new(doctor_params)
respond_to do |format|
if @doctor.save
format.html { redirect_to @doctor, notice: 'Doctor was successfully created.' }
format.json { render :show, status: :created, location: @doctor }
else
format.html { render :new }
format.json { render json: @doctor.errors,status:: unprocessable_entity }
end
end
end
//ルート:
Rails.application.routes.draw do
resources :catergories do
resources :doctors
end
root 'catergories#index'
end
私は理解できません –
あなたの質問を編集し、あなたの 'routes.rb'とその' doctors_controller.rb'ファイルを表示してください – Hizqeel