I am having a problem in sending loggedin user and also his website
name as paramters .So that he can have preview of that.
Relationship : I have 2 models user an website and relationship
between them is
user :has_one website
So when i click on <%= link_to
‘preview’ ,:controller=>‘home’,:action=>‘index’ %> , in this i need to
send respective user who has logged in and also his corresponding
website. SO how can i send these values as paramters.
So when i click on <%= link_to
‘preview’ ,:controller=>‘home’,:action=>‘index’ %> , in this i need to
send respective user who has logged in and also his corresponding
website. SO how can i send these values as paramters.
That rather depends on how you are handling logging in. Possibly you
have stored the current logged in user id in the session? If so then
you do not need to pass it, just get it out of the session. Once you
have the user then you can get his website as @user.website or
similar.
Colin
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.