缺少模板admin/citizens/create,admin/application/create,application/create with {:locale => [:en],:formats => [:html] ,:variants => [],:handlers => [:erb,:builder,:raw,:ruby,:coffee,:haml,:jbuilder,:rabl]}。搜索:*「/ Users/aa/Sites/Active Shehri/activeshehri-mongo/app/views」*「/Users/aa/.rvm/gems/[email protected]/gems/wiselinks-1.2.1/app/views「*」/Users/aa/.rvm/gems/[email protected]/gems/rails_admin-0.6.6/app/views「*」/Users/aa/.rvm/gems/ruby [email protected]/gems/kaminari-0.16.1/app/views「*」/Users/aa/.rvm/gems/[email protected]/gems/devise_invitable-1.5.5/app/views 「*」/Users/aa/.rvm/gems/[email protected]/gems/twitter-bootstrap-rails-3.2.2/app/views「*」/Users/aa/.rvm/gems/ruby [email protected]/gems/devise-3.4.1/app/views」創建新用戶時出現Missing Template錯誤
.....這裏是代碼
= form_for [:admin, @user] do |f|
.row
.col-lg-6
.panel
.panel-heading Edit Landmark
.panel-body
.form-group
= f.label :first_name
= f.text_field :first_name, class: 'form-control'
.form-group
= f.label :last_name
= f.text_field :last_name, class: 'form-control'
.form-group
= f.label :email
= f.text_field :email, class: 'form-control'
.form-group
= f.label :gender
= f.text_field :gender, :class => 'form-control'
.form-group
= f.label :contact_no
= f.text_field :contact_no, :class => 'form-control'
.form-group
= f.label :address
= f.text_field :address, class: 'form-control'
= f.submit 'Save', class: 'btn btn-primary btn-submit btn-lg pull-right'
= link_to "Back", admin_home_user_panel_path, class: 'btn btn-primary btn-submit btn-lg pull-left'
使用redirect_to或呈現on ce對象保存在您的創建操作中。因爲您沒有create.html.erb –
您確定您的app/views/admin/citizen文件夾中有create.html –
已使用redirect_to admin_home_user_panel_path –