Rails 5
Postgresql 9.4.10
Postgis 2.1.8
当我尝试rake db:reset时,控制台显示错误
Run Code Online (Sandbox Code Playgroud)rake aborted! ActiveRecord::StatementInvalid: PG::DependentObjectsStillExist: ERROR: cannot drop table spatial_ref_sys because extension postgis requires it HINT: You can drop extension postgis instead. : DROP TABLE "spatial_ref_sys" CASCADE
我是psql和postgis的新手,任何帮助将不胜感激.
我找到了一段代码,谁能告诉我comment:主要用于什么以及如何在表名和字段上添加注释?
我使用 PostgreSQL。
create_table "sun", force: :cascade, comment: "The center" do |t|
t.string "distance", comment: "Long way"
t.string "energy", comment: "Super power"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
Run Code Online (Sandbox Code Playgroud) 我从第一个动作中获取输入,如何将值传递给另一个动作?
example_controller.rb
def first
@first_value = params[:f_name]
end
def second
@get_value = @first_value
end
Run Code Online (Sandbox Code Playgroud)