Encapsulated javascript for landingController

This commit is contained in:
jfederico
2016-10-18 14:14:37 -04:00
parent f8ff8cdd28
commit e9f77b4e2e
4 changed files with 28 additions and 24 deletions

View File

@ -45,26 +45,6 @@
</div>
<script>
$(document).ready(function($) {
$('#join_form_button').click (function (event) {
$.ajax({
url : $(this).data ('url') + "?name=" + $('#join_form_name').val(),
dataType : "json",
async : true,
type : 'GET',
success : function(data) {
$(location).attr("href", data.response.join_url);
},
error : function(xhr, status, error) {
},
complete : function(xhr, status) {
}
});
});
});
</script>
<% if current_user.nil? %>
<ul>
<li><%= link_to 'Twitter', '/auth/twitter' %></li>

View File

@ -8,7 +8,7 @@
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
</head>
<body>
<body data-controller="<%= params[:controller] %>" data-action="<%= params[:action] %>">
<!-- Messages -->
<div id='messages' class='hidden'>
</div>