0

I have a column type TEXT in my database. What type of parameter should I declare in my API?

params do
  requires :body, type: Text
end

The code above produces this error: uninitialized constant API::Articles::Text (NameError)

I tried setting the parameter as a type: String, but my test responded with an ArgumentError.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Roshan
  • 905
  • 9
  • 21

1 Answers1

0

Somehow API params doesn't accept column name body. This was the reason for the error. I managed to solve it by changing the attribute name.

Roshan
  • 905
  • 9
  • 21