3

I got this error in active-resource using grape gem with an entity.

I got this result on the browser

{"page":null,"per_page":null,"total_count":null,"total_pages":null,"medicines_being_taken":7,"medicines":[{"created_by":null,"chronic_state":false,"driving_alert":null,"dopping_alert":null,"pregnancy_alert":null,"special_medicine":true,"user_active_state":true,"prescribed_by_name":true,"breastfeeding_alert":null,"complete_medicine_id":null,"last_prescription_id":null,"photosensitivity_alert":null,"last_interaction_updated_at":null,"has_medicine_simposium_interactions":false}

But when I used rails application to fetch records from grape API I got this error

 #<ArgumentError: expected attributes to be able to convert to Hash, got ["page", nil]>

The result is in the hash format.

Dipali Nagrale
  • 510
  • 5
  • 17
  • Rails was expecting the @attributes to be able to respond to being converted to a `Hash`, but it's currently receiving an `Array`. What happens when you call `.inspect` or `.class`? – J.R. Bob Dobbs Mar 04 '22 at 04:03

0 Answers0