-
Notifications
You must be signed in to change notification settings - Fork 151
Grape
Dmitry Babenko edited this page Jun 14, 2016
·
3 revisions
When using Grape you need to explicitly use body
within on
blocks.
post do
rate_topic = RateTopic.new
rate_topic.on(:success) do |rating|
status(200)
body { message: "Woo hoo!" }
end
rate_topic.on(:failure) do |errors|
render_api_error!(errors, 400)
end
rate_topic.execute(rating)
end
Need to ask a question? Please ask on StackOverflow tagging the question with wisper.
Found a bug? Please report it on the Issue tracker.