fixed error messages upon user creation
This commit is contained in:
@@ -5,9 +5,9 @@ $(function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (Danbooru.meta("errors")) {
|
if (Danbooru.meta("errors")) {
|
||||||
$("#p1").hide();
|
// $("#p1").hide();
|
||||||
$("#notice").hide();
|
// $("#notice").hide();
|
||||||
} else {
|
} else {
|
||||||
$("#p2").hide();
|
// $("#p2").hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ class UsersController < ApplicationController
|
|||||||
|
|
||||||
def create
|
def create
|
||||||
@user = User.create(params[:user])
|
@user = User.create(params[:user])
|
||||||
|
flash[:notice] = "There were errors" if @user.errors.any?
|
||||||
session[:user_id] = @user.id
|
session[:user_id] = @user.id
|
||||||
set_current_user
|
set_current_user
|
||||||
respond_with(@user)
|
respond_with(@user)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<% content_for(:secondary_links) do %>
|
<% content_for(:secondary_links) do %>
|
||||||
<menu>
|
<menu>
|
||||||
<li><%= link_to "Listing", users_path %></li>
|
<li><%= link_to "Listing", users_path %></li>
|
||||||
<li><%= link_to "Register", new_user_path %></li>
|
<li><%= link_to "Signup", new_user_path %></li>
|
||||||
<% if @user && !@user.new_record? %>
|
<% if @user && !@user.new_record? %>
|
||||||
<li>|</li>
|
<li>|</li>
|
||||||
<li><%= link_to "Edit", edit_user_path(@user) %></li>
|
<li><%= link_to "Edit", edit_user_path(@user) %></li>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<div id="c-users">
|
<div id="c-users">
|
||||||
<div id="a-new">
|
<div id="a-new">
|
||||||
<h1>Registration</h1>
|
<h1>Signup</h1>
|
||||||
|
|
||||||
<div id="p1">
|
<div id="p1">
|
||||||
<p><%= Danbooru.config.app_name %> is ad-sponsored and does not require an account to view. But in order to start uploading, editing, or creating content on this site, you will need to register. <em>Make sure you read and agree to the <%= link_to "terms of service", terms_of_service_path %> before registering. <strong>This site is open to web crawlers, therefore any name you choose will be public!</strong></em></p>
|
<p><%= Danbooru.config.app_name %> is ad-sponsored and does not require an account to view. But in order to start uploading, editing, or creating content on this site, you will need to register. <em>Make sure you read and agree to the <%= link_to "terms of service", terms_of_service_path %> before registering. <strong>This site is open to web crawlers, therefore any name you choose will be public!</strong></em></p>
|
||||||
@@ -42,10 +42,6 @@
|
|||||||
|
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<footer class="nav-links">
|
|
||||||
<%= link_to "Continue »".html_safe, new_user_path(:anchor => "p2") %>
|
|
||||||
</footer>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="p2">
|
<div id="p2">
|
||||||
@@ -65,19 +61,15 @@
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<%= simple_form_for(@user) do |f| %>
|
<%= simple_form_for(@user) do |f| %>
|
||||||
<%= error_messages_for("user") %>
|
|
||||||
|
|
||||||
<%= f.input :name %>
|
<%= f.input :name %>
|
||||||
<%= f.input :password %>
|
<%= f.input :password %>
|
||||||
<%= f.input :password_confirmation %>
|
<%= f.input :password_confirmation %>
|
||||||
<%= f.input :email, :required => false %>
|
<%= f.input :email, :required => false %>
|
||||||
<%= f.button :submit %>
|
<%= f.button :submit %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
</div>
|
||||||
<footer class="nav-links">
|
|
||||||
<%= link_to "« Back".html_safe, new_user_path(:anchor => "p1") %>
|
<%= render "secondary_links" %>
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user