13 Apr /JSON API Resource GEM

Posted by Dom Miller

Working on a Rails project using JSON API Resource gem I came across an interesting “gotcha”. When making a POST request and the JSON key is multiple words you must use dashes to separate the words, the corresponding incoming param uses underscore.

For example you have the following Model attribute: date_of_birth. JSON API Resource will not accept “date_of_birth” only “date-of-birth”.