[LRUG] more details of noob problem

Tom Armitage tom at infovore.org
Wed Apr 25 15:15:41 PDT 2007


Erin is right: it's missing one last "end":

class UserController < ApplicationController
   def index
       @title = "Crowded Film User Hub"
   end
   def register
     @title = "Register"
     if request.post? and params[:user]
       @user = User.new(params[:user])
       if @user.save
         flash[:notice] = "User #{@ user.screen_name} created!"
         redirect_to :action => "index"
       end
     end
   end
end

as regards your other issue... that doesn't look like an error to me.  
That looks like the debug hash. Do you have a view set up for  
site#index ?

t.

On 25 Apr 2007, at 22:40, Thomas Tilley wrote:

> OK (so as you all guessed I am using a tutorial). I haven't been  
> able to find out where the error is.
>
> I think the offending code is somewhere on the controller-the code  
> is below:
>
> class UserController < ApplicationController
> def index
> @title = "Crowded Film User Hub"
> end
> def register
> @title = "Register"
> if request.post? and params[:user]
> @user = User.new(params[:user])
> if @user.save
> flash[:notice] = "User #{@ user.screen_name} created!"
> redirect_to :action => "index"
> end
> end
> end
>
>
> The error I'm getting is below:
>
> app/controllers/user_controller.rb:14: syntax error, unexpected  
> $end, expecting kEND
>
> On other pages I'm seeing this (I guess related) error:
> --- !map:HashWithIndifferentAccess
> action: index
> controller: site
> As you can guess I'm way out of my depth. Just hoping to learn a  
> little before I drown :(
> _______________________________________________
> chat mailing list
> chat at lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org


---
Tom Armitage
tom at infovore.org
07813 060578




More information about the Chat mailing list