fixed calling modal

This commit is contained in:
Beatrice Olivera 2018-08-31 11:29:24 +01:00
parent 18bc693b5c
commit 0b377cbe20
5 changed files with 16 additions and 5 deletions

View File

@ -36,7 +36,6 @@ class PagesController < ApplicationController
chat_room_id: chat_room.id
}
})
end
def accept_call

View File

@ -0,0 +1,8 @@
import "bootstrap";
const btn = document.getElementById("modalTrigger");
const modal = document.getElementById("myModal");
btn.addEventListener('click', function(event) {
$('#myModal').modal('show');
});

View File

@ -18,13 +18,14 @@ end
</div>
</div>
<div class="call" data-user-id="<%= contact.id %>">
<%= link_to establish_call_path(contact.id), 'data-toggle':"modal", 'data-target':"#myModal" do %>
<%= link_to establish_call_path(contact.id), remote: true, id: "modalTrigger" do %>
<i class="fas fa-phone"></i>
<% end %>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="vertical-alignment-helper">
@ -58,3 +59,6 @@ end
</div>
</div>
</div>
<%= javascript_pack_tag 'modal' %>

View File

@ -15,6 +15,8 @@ module Polyglot
end
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 5.2
config.action_view.embed_authenticity_token_in_remote_forms = true
# Settings in config/environments/* take precedence over those specified here.
# Application configuration can go into files in config/initializers

View File

@ -10,9 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
# ActiveRecord::Schema.define(version: 2018_08_30_100110) do
ActiveRecord::Schema.define(version: 2018_08_29_123204) do
ActiveRecord::Schema.define(version: 2018_08_30_100110) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"