Forum: Ruby on Rails Building Rails API

1420cf6258a06ec2e78aff1a3db12449?d=identicon&s=25 David Orinameh (factomeme)
on 2016-12-20 09:56
Hi all, I am new here. I am building a location-based backend and so
far, I have a User and Location model. According to my relationships, a
Location has many users and a User belongs to a location which means I
need to have location_id column in the user table as the foreign key.
But when I try to authenticate a user in Locations controller, I get an
error. i.e current_user.location = @location shows no method error
'location' whereas I have location_id in user table. Please house, how
do I go about this? This is a major problem and I need to meet a
deadline.

Thanks in advance
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.