I am building a social network in Ruby on rails. I am trying to add user_id to a users status but it produces an error. The code can be found at my github: https://github.com/lewisfrost/treebook.git
Can you please help? I have been stuck on this all day!!
Thanks
In order to try to get the first_name and last_name of your user associated with your status, you can use the very handy & meaning method try !
You could do something like this in your view:
It will try to get the first_name of the user if it exists, and not raise an error if the user doesn’t exist!