Closed khacluan closed 8 years ago
Seems problematic, you should build a test case here for this to begin with.
@khacluan this is many months late, but you can use ASM's meta
functionality to achieve your use-case. Try this:
class Registrations < Grape::API
resource :users do
get "/", meta_key: message, meta: 'Hello' do
user
end
end
end
something like this would also work if you need to programmatically define the message
class Registrations < Grape::API
resource :users do
get "/" do
render user, meta_key: message, meta: 'Hello'
end
end
end
I'm going to close this issue, as it is almost a year old. If the above doesn't work, please open a new issue.
I tried to response user with serialize, but not success
I want result like that
{message: "hello", user: {id: 1, first_name: "A", last_name: "B", email: "abc@gmail.com"}}
but it response all attributes of User