Updated routes and user form to avoid user-create conflicts with devise
This commit is contained in:
parent
63b1b05010
commit
7cadcabdce
|
@ -1,4 +1,9 @@
|
|||
<%= form_for(@user) do |f| %>
|
||||
<% if @user.id.blank? then
|
||||
this_url = users_create_path
|
||||
else
|
||||
this_url = user_path(@user)
|
||||
end %>
|
||||
<%= form_for @user, :url => this_url do |f| %>
|
||||
<% if @user.errors.any? %>
|
||||
<div id="error_explanation">
|
||||
<h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>
|
||||
|
|
|
@ -6,6 +6,7 @@ Dooraccess::Application.routes.draw do
|
|||
|
||||
devise_for :users
|
||||
resources :users
|
||||
match 'users/create' => 'users#create', :via => :post # Use POST users/create instead of POST users to avoid devise conflict
|
||||
|
||||
match 'cards/upload_all' => 'cards#upload_all', :as => :upload_all
|
||||
resources :cards
|
||||
|
|
Loading…
Reference in New Issue
Block a user