Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Had to re-do my README. Project is done, and ready to be looked at! #14

Open
wants to merge 53 commits into
base: master
Choose a base branch
from

Conversation

vineetrastogi
Copy link

No description provided.

# analyzes and stores login/registration info
post '/' do
# checking if registration info is correct
if params[:new_password].blank? && params[:new_username].blank?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These validations should be inside your model. Also your params should either be params[:username] params[:password] or params[:user][:username] params[:user][:password]

post '/' do
  @user = User.new(username: params[:username], password: params[:password], email: params[:email])
  if @user.save
    login_as_user(@user)
    redirect '/'
  else
    erb :index # use @user in the template to display errors from validations
  end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants