So the step I'm having trouble with (Step 2) reads as follows:
"Between the new action and the private method, add the create action"
The code it want's me to add looks roughly* like this (*I added a bit more whitespace to make it look a little cleaner):
def create @user = User.new(user_params) if @user.save session[:user_id] = @user.id redirect_to '/' else redirect_to '/signup' end end
The problem I'm having is that for some reason I am unable to complete this step, and I don't get any error messages.
For those that need it, my code is as follows:
class UsersController < ApplicationController def new @user = User.new end def create @user = User.new(user_params) if @user.save session[:user_id] = @user.id redirect_to '/' else redirect_to '/signup' end end private def user_params params.require(:user).permit(:first_name, :last_name, :email, :password) end end
Additional information that might be relevant:
- I used the tab button to make my whitespace in my actual code for my formatting but, used spaces here.
- If it might be my browser, I use google chrome, I have attempted to try and pass this step with safari as well but, might also be worth testing with safari if necessary.