Category : ruby-on-rails

I am not sure why the application.js under assets/javascripts/admin/donations is not getting loaded on a modal partial view rendered via AJAX remote: true. It works for other views without remote: true. Code for show.html.haml. = ui.example :dropdown_item, :remote, href: new_admin_donation_path(event_id: event.id), body: ‘Add Donation’, Modal will be rendered when "Add Donation" button will be clicked. ..

Read more

I am using gem ‘local_time’ https://github.com/basecamp/local_time in my Ruby on Rails application (in production environment). It works when I open app from mac OS, but when I try open my website from iphone or android, javascript doesn’t work and I see date_time attributes in UTC time-zone. help me with javascript please Source: Ask Javascript..

Read more

I have the following flow: User loads page SPA Through JS (Ajax) I am requesting a certain location every second: http://192.168.1.1/settings I ask the user to switch WIFI networks to the device (that has the /settings endpoint) Then I get this message: Refused to connect to ‘http://192.168.33.1/settings’ because it violates the following Content Security Policy ..

Read more

$(document).ready(function(){ var table = $(“#friendstable”).DataTable({ “processing”: true, “serverSide”: true, “columnDefs”: [{ “orderable”: false, “targets”: -1 }], “ajax”:{ “url”: $(‘#users-datatable’).data(‘source’)}, “pagingType”: “full_numbers”, “columns”: [ {“data”: “first_name”}, {“data”: “last_name”}, {“data”: “email”}, {“data”: “phone”}, {“data”: “age”}, {“data”: “twitter”} ], }); $(‘#friendstable thead tr:eq(1) th’).each(function() { $(this).html(‘<input type=”text” style=”width:100%;align=center;” class=”form-control” />’); }); table.columns().every(function(index) { var that = this; $(‘#friendstable ..

Read more