Created
September 9, 2017 00:01
-
-
Save searls/84f332fe0842ef35b72249505fce9892 to your computer and use it in GitHub Desktop.
Ok, so there is one downside to webapp dev on an ipad…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.puts = (...anything) => { | |
fetch("/api/puts", { | |
method: 'POST', | |
headers: { | |
'Content-Type': 'application/json' | |
}, | |
body: JSON.stringify({content: anything}) | |
}) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Api | |
class PutsController < ApiController | |
def create | |
puts <<~TEXT | |
Client logger says: | |
#{params[:content].map(&:to_json).join(", ")} | |
TEXT | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment