Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Silly End Syntax Error

I've copied this exactly as the man with the creepy smile did but I'm still getting a syntax error and I've had enough of staring at it.

Error code on test:

C:\Sites\treebook>ruby -Itest test/functional/profiles_controller_test.rb C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require': C:/Sites/treebook/app/controllers/profiles_controller.rb:12: syntax error, unexpected $end, expecting keyword_end (SyntaxError)

Code from profiles controller:

class ProfilesController < ApplicationController
  def show

    @user = User.find_by_profile_name(params[:id])

    if @user
        render action: :show
    else
      render file: 'public/404', status: 404, formats: [:html]

   end
 end

Does your ProfilesController have a final end?

class ProfilesController < ApplicationController
  def show

    @user = User.find_by_profile_name(params[:id])

    if @user
        render action: :show
    else
      render file: 'public/404', status: 404, formats: [:html]
   end # this end terminates the if

 end # this end terminates the show method

end  # this end terminates the profile class

2 Answers

if's need terminating?

Wish they told me this on the video, thanks

lol... yes they do; you could do the Ruby foundations track as well (just one more time if you haven't)

Thanks for the help. Most of the errors I have are forgetting to include a : or ? or %> and that is frustrating.

I'm almost completed the Ruby SImple program.