azochz
azochz

Reputation: 1055

Getting unexpected keyword_end, expecting end-of-input Syntax Error - can't find issue

I'm getting a unexpected keyword_end, expecting end-of-input syntax error for my UsersController class, but can't for the life of me figure out what here is spelled wrong/why end is throwing it off.

Class UsersController < ApplicationController
   before_action :authenticate_user!

   def update
     if current_user.update_attributes(user_params)
       flash[:notice] = "User information updated"
       redirect_to edit_user_registration_path
     else
       flash[:error] = "Invalid user information"
       redirect_to edit_user_registration_path
     end
   end

   private

   def user_params
     params.require(:user).permit(:name, :avatar)
   end
end

Upvotes: 0

Views: 77

Answers (1)

Paweł Dawczak
Paweł Dawczak

Reputation: 9639

When defining the class, the keyword "class" should be of lowercase, not uppercase, so try changing:

Class UsersController < ApplicationController

to

class UsersController < ApplicationController

Hope that helps!

Upvotes: 1

Related Questions