Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/63.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 最好的地方不保存_Ruby On Rails_Ruby - Fatal编程技术网

Ruby on rails 最好的地方不保存

Ruby on rails 最好的地方不保存,ruby-on-rails,ruby,Ruby On Rails,Ruby,因此,我正在使用最佳就地gem允许用户就地编辑他们的照片标题。但是,输入的文本未保存或存储在数据库中 以下是与此区域相关的架构快照: create_table "photos", force: true do |t| t.string "file" t.integer "attachable_id" t.datetime "created_at" t.datetime "updated_at" t.string "attachable_typ

因此,我正在使用最佳就地gem允许用户就地编辑他们的照片标题。但是,输入的文本未保存或存储在数据库中

以下是与此区域相关的架构快照:

  create_table "photos", force: true do |t|
    t.string   "file"
    t.integer  "attachable_id"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "attachable_type"
    t.string   "title"
    t.text     "description"
    t.boolean  "profile_photo",   default: false
  end
下面是查看代码:

 <p class="summary-info"><%= text_field photo, :description, placeholder: 'Add a description...' %></p>

我做错了什么

更新:

 <p class="summary-info"><%= best_in_place photo, :description, type: :textarea, nil: 'Enter a Caption' %></p>


您没有在视图中使用
最佳位置
辅助方法。查看或

你必须这样做:

<%= best_in_place @photo, :description, type: :input %>

根据你的需要调整它


仅供参考:
text\u字段
是一个。

我研究了它,我认为text\u字段是文本字段最佳位置gem的助手方法?我是否将最佳就地辅助方法与文本字段辅助方法一起添加?谢谢