ฉันได้สร้างมุมมองด้วยคำสั่งนี้หลังจากติดตั้งอุปกรณ์แล้ว
rails generate devise:views
และฉันแทนที่ตัวควบคุมการลงทะเบียนด้วย
class RegistrationsController < Devise::RegistrationsController
def sign_up2
end
end
และอัพเดตเส้นทาง.rbด้วย
devise_for :users, :controllers => { :registrations => "registrations" }
ฉันคาดว่าจะเห็นเส้นทาง / มุมมองใหม่ของ
/users/sign_up2
แต่ฉันไม่เห็นมัน และนี่คือเส้นทางสำหรับการประดิษฐ์
new_user_session GET /users/sign_in(.:format) devise/sessions#new
user_session POST /users/sign_in(.:format) devise/sessions#create
destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy
user_password POST /users/password(.:format) devise/passwords#create
new_user_password GET /users/password/new(.:format) devise/passwords#new
edit_user_password GET /users/password/edit(.:format) devise/passwords#edit
PATCH /users/password(.:format) devise/passwords#update
PUT /users/password(.:format) devise/passwords#update
cancel_user_registration GET /users/cancel(.:format) registrations#cancel
user_registration POST /users(.:format) registrations#create
new_user_registration GET /users/sign_up(.:format) registrations#new
edit_user_registration GET /users/edit(.:format) registrations#edit
PATCH /users(.:format) registrations#update
PUT /users(.:format) registrations#update
DELETE /users(.:format) registrations#destroy
แต่ฉันอยากได้มุมมองและเส้นทางใหม่
อัปเดต: ปัญหาเมื่อฉันโหลดมุมมอง
First argument in form cannot contain nil or be empty
ในบรรทัดนี้
<%= form_for(resource, :as => resource_name,:html => { :class => "form-horizontal col-sm-12",:role=>"form"}, :url => user_registration_path(resource_name)) do |f| %>