most likely

@username = current_user_session.user.username

which will probably work better as

@username = current_user.username


and

 @welr = '¡Bienvenid@ ' + @username.to_s + ' a nuestra web!'

is better as

 @welr = "¡Bienvenid@ #{@username} a nuestra web!"


On Sat, Jun 11, 2011 at 10:06 AM, Distriker <[email protected]
> wrote:

> Hi again, sorry for many questions. In mi HomeController, I have the
> "hi" method, in this method I use an "if" for show a different message
> for a registered user or a guest. When I call in "home/index" my
> method "hi", show me this error message:
>
> "Stack level too deep"
>
>



> class HomeController < ApplicationController
>  def hi
>    if (current_user)
>      @username = current_user_session.user.username
>      @welr = '¡Bienvenid@ ' + @username.to_s + ' a nuestra web!'
>      render 'home/index'
>    else
>      @weli = "¡Bienvenid@ invitad@, no dude en registrarse!"
>    end
>  end
> end
>
> # home/index
> <p>Holaaaa</p>
> <%= @controller.hi %>
>
> Well, I have trying find the solution, but I haven't can. Can anyone
> help me?
>
> Rewards, Iván
>
> --
> 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.
>
>

-- 
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