尝试在Rails中自定义设计视图

时间:2015-11-01 05:25:29

标签: ruby-on-rails ruby-on-rails-3 ruby-on-rails-4 devise

所以,基本上我的应用程序中有2个用户,他们是公司和企业。

问题是我想为每个人自定义编辑视图,但 edit_company_registration edit_establishment_registration 正在呈现 views / devise / registrations / edit .html.erb 而不是 views / company / registrations / edit.html.erb views / establishment / registrations / edit.html.erb ,所以我不能单独定制每一个,除了这个问题,每当我尝试编辑记录(公司或机构)时,我都会收到此错误。

enter image description here

我不知道为什么会这样(我显然填满了所有领域),我不知道这是否是上述影响的一部分(链接到 edit_company_registration edit_establishment_registration 正在呈现 views / devise / registrations / edit.html.erb )。

告诉我做了什么,我使用了这个命令:

rails generate devise:views

要在 app / views / company app / views / admin 中查看设计视图,请执行以下操作:

enter image description here

但正如我所说,如果我尝试转到 edit_establishment_registration edit_company_registration ,它会呈现设计/注册#edit 而不是建立/注册/ edit.html.erb 公司/注册/ edit.html.erb ,我该如何解决这个(或这些)问题?我需要帮助。

如果你有点困惑,这就是我想要做的事情:

  1. 能够单独自定义每个编辑视图,为此我想我必须以某种方式使其从 edit_establishment_registration 渲染 views / establishment / registrations / edit.html.erb (公司的情况相同)。
  2. 解决问题,告诉我密码不能为空(可能是 edit_company_registration edit_compablishment_registration 这一事实的副作用正在渲染 views / devise / registrations / edit.html.erb ,我不知道。
  3. 问候。

0 个答案:

没有答案