Reputation: 3
I am trying to find the address by the "address_id" column in the user model to then render that address.
Note: Since this is easypost I did not make the address model itself and there is no association between the user model and the address object.
my _user.json.jbuilder file:
json.extract! user, :id, :username, :created_at, :updated_at, :deleted_at, :is_disabled
json.address EasyPost::Address.retrieve(user.address_id), partial: 'addresses/address', as: :address
I was expecting the above code to find the address and go to _address.json.jbuilder to render it as part of the user:
json.extract! address, :street1, :street2, :city, :state, :zip, :country, :residential
error that I am getting:
"ActionView::Template::Error: The requested resource could not be found."
Upvotes: 0
Views: 65
Reputation: 89
This error "The requested resource could not be found." is any EasyPost API error which could indicate the following possibilities:
Upvotes: 0