Signed-off-by: Adrian Hinz <ahinz@voicetelecom.pl>

This commit is contained in:
Adrian Hinz 2017-06-29 07:01:11 +02:00
parent dcc3bc97d6
commit 951673c9b5
2 changed files with 15 additions and 1 deletions

View File

@ -12,7 +12,7 @@ class ApplicationController < ActionController::Base
def set_headers
headers['Access-Control-Allow-Origin'] = 'lvh.me'
headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'
headers['Access-Control-Request-Method'] = 'lvh.me'
headers['Access-Control-Request-Method'] = '*'
headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'
end

View File

@ -23,5 +23,19 @@
<%= decimal_to_word(127786.9) %><br />
<%= decimal_to_word(599.99) %><br />
Pellentesque luctus quam quis consequat vulputate. Sed sit amet diam ipsum. <br>
<input type="text" id="msg" value="hello" /><br />
<input type="text" id="domain" value="lvh.me" /><br />
<button onClick="return sendToParent()">Zapisz</button>
</div>
</div>
<script type="text/javascript">
function sendToParent() {
var msg = $('#msg').val();
var domain = $('#domain').val();
parent.postMessage(msg,domain);
}
$(document).ready(function () {
});
</script>