OK Great...

You were calling the + method, which concatenates two string objects, on a
User object. In your original code, the @login variable did not hold a
string object, but a user object (returned by the call to
User.find_by_login( ... ).

Ruby was rightfully complaining that the + method was not defined on the
user object. @user.login returns a string, which does have the + method and
therefore you can concatenate with the rest of your string (in the flash
message).



On Mon, Mar 9, 2009 at 7:59 PM, Chris Gunnels <
[email protected]> wrote:

>
> Harold wrote:
> > In that case, try:
> >
> > class MemberController < ApplicationController
> >   def index
> >     @user= User.find_by_login(params[:l])
> >     flash[:notice] = @user.login + ", you've logged in successfully"
> >   end
> > end
> >
> >
> >
> > On Mar 9, 7:24�pm, Chris Gunnels <[email protected]>
>
> Your changes worked...What was I doing wrong?
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to