컨트롤러의 표시 및 편집 작업이 호출 될 때마다이 오류가 발생했습니다. 3.0.10에서 App 3.1으로 업그레이드했는데 문제는 다른 컨트롤러가 예상대로 작동하므로 업그레이드와 관련이 있습니다. RuntimeError : 예기치 않게 데이터 잘림 Error Rails 3.1
RuntimeError: unexpectedly data truncated:SELECT `courses`.* FROM `courses` WHERE `courses`.`id` = ? LIMIT 1
내 컨트롤러의 편집과 액션
def edit
...
@course = Course.find(params[:id])
@title = "#{@course.name}'s Details"
...
end
def show
...
@title = "Course Detail"
@course = Course.find(params[:id])
...
end
을 보여 MySQL의
을 사용하여 임 그리고보기는<%= form_for @course do |f|%>
<%= render 'form' ,:f => f%>
<%= f.submit :class=> "btn " %>
<%= link_to "Delete User" , @course, :method =>:delete,:confirm =>"You Sure?",
:title => "Delete #{@course.email}",:class => "btn " %>
<%= link_to 'Cancel', courses_path,:class => "btn" %>
<% end %>
편집
오류의 원인에 관해서는 약간의 단서가
create_table "courses", :force => true do |t|
t.string "date"
t.string "time"
t.string "venue"
t.integer "roomnumber"
t.string "tutor"
t.string "type"
t.string "name"
t.string "description"
t.string "status"
t.string "duration"
t.integer "maxallowed"
t.datetime "created_at"
t.datetime "updated_at"
end
더 많은 정보가 필요하다고 생각합니다. 질문을 편집하고 schema.db에서 courses 테이블 섹션을 추가하여 정의 방법을 볼 수 있습니까? –