I realize the title probably doesn't make much sense, but that was the
best short description I could come up with.
Anyway, I have users and pages in my site, and was using the following
code in the users controller, which works fine:
<code>
def show
@user = User.find(params[:id])
@title = @user.Fname + " " + @user.Lname
en
</code>
However, if I go to the pages controller, and use the following code, I
get "Couldn't find user without an id" for an error.
<code>
def home
@title = "Home"
@user = User.find(params[:id])
end
</code>
Using User.find(1) works just fine instead of User.find(params[:id])
I feel like I'm probably just restricting something to Users only
somehow, but can't figure it out. Seems like it would be obvious to
someone more experienced, (I hope?)
--
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.