與此命令我已生成的視圖後,我安裝設計滑軌添加新視圖制定
rails generate devise:views
和我通過
class RegistrationsController < Devise::RegistrationsController
def sign_up2
end
end
重寫註冊控制器和帶有
devise_for :users, :controllers => { :registrations => "registrations" }
更新的routes.rb
我期待看到一條新路線/觀點
/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| %>
你想添加什麼視圖和路線? – zeantsoi
@zeantsoi sign_up2 – wwli
瞭解。看看我的答案。 – zeantsoi