When a request returns the json that is placed in the handlebar template how/can I access attributes of a rails association like the ‘user’ of a ‘post’ as the only attribute in the json is the user_id?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The associated model and attributes-optional, need to be passed to the json in the controller:
See to_json (apidock)