I\'m trying to build an API in rails 4, and am having an issue where rails returns a 500 error instead of a 406 when using respond_to :json and trying to access
respond_to :json
when you try a responses in json is beacuse you only need some properties i used this
@my_model=Model.select(:attributeN, :attributeN......, attributeN) respond_to do |format| format.json { render json: @my_model } end