app/controllers/sessions_controller.rb
# THIS IS PROBABLY NOT SECURE.
# If and when that matters, implement a real authentication solution.
THIS IS PROBABLY NOT SECURE.
If and when that matters, implement a real authentication solution.
THIS IS PROBABLY NOT SECURE . If and when that matters implement a real authentication solution .
def create
    @user = User.create(name: params[:user][:name])
    if @user.valid?
      User.set_encrypted_session_id(cookies, @user.id)
      redirect_to root_path
    else
      flash.now[:error] = @user.errors.full_messages.join(', ')
      render :new
    end
  end
def create @user = User . create ( name : params [ :user ] [ :name ] ) if @user . valid? User . set_encrypted_session_id ( cookies , @user . id ) redirect_to root_path else flash . now [ :error ] = @user . errors . full_messages . join ( ', ' ) render :new end end
THIS IS PROBABLY NOT SECURE.
THIS IS PROBABLY NOT SECURE .