Answer the question
In order to leave comments, you need to log in
How to set identifiers to an integer in Rails?
I have an API method that returns JSON floating point identifiers (2624.0). Although in fact an integer (2624) should be displayed. How can this be fixed?
def index
@users = User.all
render json: @users
end
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question