Note that there are some explanatory texts on larger screens.

plurals
  1. PORails: Can't seem to sign up users
    primarykey
    data
    text
    <p>Basically my sign up form is not working. When I sign someone up it states that the user exists </p> <pre><code>(0.1ms) begin transaction User Exists (0.2ms) SELECT 1 FROM "users" WHERE LOWER("users"."email") == LOWER('sambam@herpderp.edu') LIMIT 1 (0.1ms) rollback transaction </code></pre> <p>I am unsure what the issue is. Here are some of my model code and controller code.</p> <p>User Model</p> <pre><code>class User &lt; ActiveRecord::Base attr_accessible :name, :email, :password, :password_confirmation, :biography, :avatar has_secure_password before_create { generate_token(:auth_token) } validates :name, presence: true, length: { maximum: 20 } valid_email_regex = /\A[\w+\-.]+@[a-z\d\-.]+\.edu/i validates :email, presence: true, format: { with: valid_email_regex }, uniqueness: { case_sensitive: false } validates :password, length: { minimum: 6}, :on =&gt; :create validates :password_digest, presence: { message: "Password can't be blank" } validates :biography, presence: true, length: { maximum: 140 } has_attached_file :avatar, :styles =&gt; { :small =&gt; "75x75&gt;" } end </code></pre> <p>User Controller</p> <pre><code>class UsersController &lt; ApplicationController def new @user = User.new end def show @user = User.find(params[:id]) end def create @user = User.new(params[:user]) if @user.save redirect_to @user else redirect_to current_school end end </code></pre> <p>School Model</p> <pre><code>class School &lt; ActiveRecord::Base attr_accessible :name end </code></pre> <p>School Controller</p> <pre><code>class SchoolsController &lt; ApplicationController def create school = School.find(params[:name]) if school session[:school_id] = school.id redirect_to school_path(school) end end def show @school = School.find(params[:id]) @user =User.new end end </code></pre> <p>Sign Up Form</p> <pre><code>&lt;%= form_for @user do |f| %&gt; &lt;%= f.text_field :name, :class =&gt; 'modal_signinfield', :placeholder =&gt; 'Name' %&gt; &lt;/br&gt;&lt;/br&gt; &lt;%= f.text_field :email, :class =&gt; 'modal_signinfield', :placeholder =&gt; 'Email: Must be .edu' %&gt; &lt;/br&gt;&lt;/br&gt; &lt;%= f.password_field :password, :class =&gt; 'modal_signinfield', :placeholder =&gt; 'Password: Must be at least 6 letters' %&gt; &lt;/br&gt;&lt;/br&gt; &lt;%= f.password_field :password_confirmation, :class =&gt; 'modal_signinfield', :placeholder =&gt; 'Renter Password' %&gt; &lt;%= f.submit "Sign Up", :class =&gt; 'sign_up_button'%&gt; &lt;% end %&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload