コントローラの表示と編集のアクションが呼び出されたとき、このエラーが発生しました:3.0.10からAppへのアップグレードを行っただけですが、この問題は他のコントローラが期待どおりに動作するため、アップグレードに関連しています。 MySQLの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
とビュー
<%= 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 %>
を表示を使用してイムは、エラー
EDITのソースに、わずかな手がかりを持って
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からコース表セクションを追加して、その定義方法を確認できますか? –