From 4b998184a4993272018e2fabd24bc27ce7568d24 Mon Sep 17 00:00:00 2001 From: albert Date: Sun, 11 Sep 2011 17:24:44 -0400 Subject: [PATCH] fixed error messages upon user creation --- app/assets/javascripts/users.js | 6 +++--- app/controllers/users_controller.rb | 1 + app/views/users/_secondary_links.html.erb | 2 +- app/views/users/new.html.erb | 16 ++++------------ 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/app/assets/javascripts/users.js b/app/assets/javascripts/users.js index 6ac39528a..d433decca 100644 --- a/app/assets/javascripts/users.js +++ b/app/assets/javascripts/users.js @@ -5,9 +5,9 @@ $(function() { }); if (Danbooru.meta("errors")) { - $("#p1").hide(); - $("#notice").hide(); + // $("#p1").hide(); + // $("#notice").hide(); } else { - $("#p2").hide(); + // $("#p2").hide(); } }); diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 18350bee4..1f5788a4e 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -28,6 +28,7 @@ class UsersController < ApplicationController def create @user = User.create(params[:user]) + flash[:notice] = "There were errors" if @user.errors.any? session[:user_id] = @user.id set_current_user respond_with(@user) diff --git a/app/views/users/_secondary_links.html.erb b/app/views/users/_secondary_links.html.erb index d4e2986b9..11f8cab7b 100644 --- a/app/views/users/_secondary_links.html.erb +++ b/app/views/users/_secondary_links.html.erb @@ -1,7 +1,7 @@ <% content_for(:secondary_links) do %>
  • <%= link_to "Listing", users_path %>
  • -
  • <%= link_to "Register", new_user_path %>
  • +
  • <%= link_to "Signup", new_user_path %>
  • <% if @user && !@user.new_record? %>
  • |
  • <%= link_to "Edit", edit_user_path(@user) %>
  • diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index 9b56e4a60..0792b4ad0 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -1,6 +1,6 @@
    -

    Registration

    +

    Signup

    <%= 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. Make sure you read and agree to the <%= link_to "terms of service", terms_of_service_path %> before registering. This site is open to web crawlers, therefore any name you choose will be public!

    @@ -42,10 +42,6 @@
    - -
    - <%= link_to "Continue »".html_safe, new_user_path(:anchor => "p2") %> -
    @@ -65,19 +61,15 @@ <%= simple_form_for(@user) do |f| %> - <%= error_messages_for("user") %> - <%= f.input :name %> <%= f.input :password %> <%= f.input :password_confirmation %> <%= f.input :email, :required => false %> <%= f.button :submit %> <% end %> - - -
    +
    + + <%= render "secondary_links" %>