0

私はデバイスジェムを使用していますが、過去にユーザー登録が機能していました。しかし、何かが壊れているようです。

Mavens::Application.routes.draw do

  devise_for :users

  resources :events
  resources :periods
  resources :products
  resources :cart_rows
  resources :product_requests
  resources :inqueries
   match '/profile',  to: 'static_pages#profile'

  # resources :registrations do
  #   member do
  #     post :save_period
  #   end
  # end

  root :to => 'static_pages#home'

  get "static_pages/home"
  get "static_pages/about"
end

「登録」とは別の名前を使用する必要がありましたが、この登録はイベント用であり、ユーザー用ではありません。私はそれがこの破壊と関係があると考えてコメントしました。

これが私のレーキルートです:

   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
                         PUT    /users/password(.:format)            devise/passwords#update
cancel_user_registration GET    /users/cancel(.:format)              devise/registrations#cancel
       user_registration POST   /users(.:format)                     devise/registrations#create
   new_user_registration GET    /users/sign_up(.:format)             devise/registrations#new
  edit_user_registration GET    /users/edit(.:format)                devise/registrations#edit
                         PUT    /users(.:format)                     devise/registrations#update
                         DELETE /users(.:format)                     devise/registrations#destroy
                  events GET    /events(.:format)                    events#index
                         POST   /events(.:format)                    events#create
               new_event GET    /events/new(.:format)                events#new
              edit_event GET    /events/:id/edit(.:format)           events#edit
                   event GET    /events/:id(.:format)                events#show
                         PUT    /events/:id(.:format)                events#update
                         DELETE /events/:id(.:format)                events#destroy
                 periods GET    /periods(.:format)                   periods#index
                         POST   /periods(.:format)                   periods#create
              new_period GET    /periods/new(.:format)               periods#new
             edit_period GET    /periods/:id/edit(.:format)          periods#edit
                  period GET    /periods/:id(.:format)               periods#show
                         PUT    /periods/:id(.:format)               periods#update
                         DELETE /periods/:id(.:format)               periods#destroy
                products GET    /products(.:format)                  products#index
                         POST   /products(.:format)                  products#create
             new_product GET    /products/new(.:format)              products#new
            edit_product GET    /products/:id/edit(.:format)         products#edit
                 product GET    /products/:id(.:format)              products#show
                         PUT    /products/:id(.:format)              products#update
                         DELETE /products/:id(.:format)              products#destroy
               cart_rows GET    /cart_rows(.:format)                 cart_rows#index
                         POST   /cart_rows(.:format)                 cart_rows#create
            new_cart_row GET    /cart_rows/new(.:format)             cart_rows#new
           edit_cart_row GET    /cart_rows/:id/edit(.:format)        cart_rows#edit
                cart_row GET    /cart_rows/:id(.:format)             cart_rows#show
                         PUT    /cart_rows/:id(.:format)             cart_rows#update
                         DELETE /cart_rows/:id(.:format)             cart_rows#destroy
        product_requests GET    /product_requests(.:format)          product_requests#index
                         POST   /product_requests(.:format)          product_requests#create
     new_product_request GET    /product_requests/new(.:format)      product_requests#new
    edit_product_request GET    /product_requests/:id/edit(.:format) product_requests#edit
         product_request GET    /product_requests/:id(.:format)      product_requests#show
                         PUT    /product_requests/:id(.:format)      product_requests#update
                         DELETE /product_requests/:id(.:format)      product_requests#destroy
               inqueries GET    /inqueries(.:format)                 inqueries#index
                         POST   /inqueries(.:format)                 inqueries#create
             new_inquery GET    /inqueries/new(.:format)             inqueries#new
            edit_inquery GET    /inqueries/:id/edit(.:format)        inqueries#edit
                 inquery GET    /inqueries/:id(.:format)             inqueries#show
                         PUT    /inqueries/:id(.:format)             inqueries#update
                         DELETE /inqueries/:id(.:format)             inqueries#destroy
                 profile        /profile(.:format)                   static_pages#profile
                    root        /                                    static_pages#home
       static_pages_home GET    /static_pages/home(.:format)         static_pages#home
      static_pages_about GET    /static_pages/about(.:format)        static_pages#about

そしてここにビューページがあります:

<h2>Sign Up</h2> 
  <%= link_to "Sign in", new_session_path(resource_name) %> | <%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
  <br />

<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
  <%= devise_error_messages! %>

  <%= f.label :email %>
  <%= f.email_field :email %>

  <%= f.label :password %>
  <%= f.password_field :password %>

  <%= f.label :password_confirmation %>
  <%= f.password_field :password_confirmation %>

  <%= f.label :first_name %>
  <%= f.text_field :first_name%>

  <%= f.label :last_name %>
  <%= f.text_field :last_name%>

  <%= f.label :license_number %>
  <%= f.text_field :license_number %>

  <%= f.label :state %>
  <%= f.select :state, User::STATES%>

  <%= f.label :specialty %>
  <%= f.select :specialty, User::SPECIALTY%>



  <br />

  <%= f.submit "Sign up" %>
<% end %>

ルーティングを中断するために何を変更できたのかについてのアイデアはありますか?

4

1 に答える 1

0

私はrails dモデルとコントローラーを実行しましたが、それは機能しているように見えました。Pro_tip、変数名の前に必ず何かを付けて、プルする他のシステムの名前と競合しないようにしてください。

于 2012-08-18T13:10:37.053 に答える