2
我已经将额外的页面添加到注册控制器来清理用户帐户设置页面。我的问题是,在这些新页面上,尽管我可以更新用户的属性,但这些属性并未显示在视图中。 我指的是以前保存的属性应该显示在窗体的相应输入中。红宝石轨道上。设计注册编辑 - 用户属性不显示
我在users/edit
页面上留下的表单属性确实显示保存的属性,但新页面没有。
我已经添加了如下新页面;
途径:
devise_for :users, controllers: { registrations: "users/registrations", sessions: "users/sessions" }
devise_scope :user do
get "https://stackoverflow.com/users/account", to: "users/registrations#account"
get "https://stackoverflow.com/users/media", to: "users/registrations#media"
get "https://stackoverflow.com/users/notifications", to: "users/registrations#notifications"
end
用户/注册控制器;每一页上
def account
build_resource({})
respond_with self.resource
end
def media
build_resource({})
respond_with self.resource
end
def notifications
build_resource({})
respond_with self.resource
end
形式:
`<%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %`>
为什么不保存的属性显示在这些新的页面?