레일 코드에 문제가 있습니다. 입력을 기반으로 새로운 위치를 생성하려고합니다. 는 그래서 만드는 방법은 다음과 같습니다정의되지 않은 로컬 변수 또는 메소드`admins_root_path '
def create
@location = Location.new(params[:location])
respond_to do |format|
if @location.save
# format.html { redirect_to @location, notice: 'Location was successfully created.' }
format.html { redirect_to admins_root_path, notice: 'Location was successfully created.' }
format.json { render json: @location, status: :created, location: @location }
else
format.html { render action: "new" }
format.json { render json: @location.errors, status: :unprocessable_entity }
end
end
end
그것은 다음과 같은 오류 출력 끝 :
이undefined local variable or method `admins_root_path' for #<LocationsController:0x007fa18917f278>
app/controllers/locations_controller.rb:47:in `block in create'
app/controllers/locations_controller.rb:45:in `create'
어떤 도움은 매우 도움이 될 것입니다.
가'레이크의 출력을 게시하시기 바랍니다는 – vee
목록 당신의 루트 파일 PLZ를 routes'. –