3 ms·
I prefer REST for mainly aesthetic reasons: the URLs are pretty, and in Rails I can handle different HTTP actions in the same method, which usually ends up bein
by carsongross 11y ago
I prefer REST for mainly aesthetic reasons: the URLs are pretty, and in Rails I can handle different HTTP actions in the same method, which usually ends up being some clean code:
def index
if request.put?
update_stuff
end
# get/put render same response content
end
One of the unexpected benefits of intercooler.js has been that I can use REST-fully designed end points for my html-partial endpoints, and it all just "looks right", even though it isn't a traditional JSON API.