Dipali Nagrale
Dipali Nagrale

Reputation: 520

ArgumentError: expected attributes to be able to convert to Hash, got []

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.

Upvotes: 3

Views: 593

Answers (0)

Related Questions