Updated routes and user form to avoid user-create conflicts with devise

This commit is contained in:
Will Bradley 2013-01-25 07:11:22 -07:00
parent 63b1b05010
commit 7cadcabdce
2 changed files with 7 additions and 1 deletions

View File

@ -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? %> <% if @user.errors.any? %>
<div id="error_explanation"> <div id="error_explanation">
<h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2> <h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>

View File

@ -6,6 +6,7 @@ Dooraccess::Application.routes.draw do
devise_for :users devise_for :users
resources :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 match 'cards/upload_all' => 'cards#upload_all', :as => :upload_all
resources :cards resources :cards