覆蓋裝置注冊控制器我已經在基于不同模型的注冊表單中添加了一個字段,請參閱如何在設計模型中使用嵌套屬性?關于血淋淋的細節。這部分工作正常?,F在的問題是,當我保存時,注冊控制器的創建操作失敗了。Activerecord::UnknownAttributeError在這個領域(公司)。我假設我需要超越注冊控制器,或者有一個更好/更容易的方式,我應該接近這一點?
3 回答

江戶川亂折騰
TA貢獻1851條經驗 獲得超5個贊
# app/controllers/registrations_controller.rbclass RegistrationsController < Devise::RegistrationsController def new super end def create # add custom create logic here end def update super endend
# app/config/routes.rbdevise_for :users, :controllers => {:registrations => "registrations"}
添加回答
舉報
0/150
提交
取消