U
U
user2972018-08-17 06:38:17
Ruby on Rails
user297, 2018-08-17 06:38:17

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 question

Ask a Question

731 491 924 answers to any question