Questions tagged [jquery-rails]
27 questions
6
votes
2 answers
Is `require jquery_ujs` still needed in Rails 5.1?
I am installing jQuery in my 5.1.x Rails app via the jquery-rails gem.
In the gem setup, they recommend to add these lines to application.js by default:
//= require jquery
//= require jquery_ujs
But, in a Rails 5.1.x app, you have already this…

Hartator
- 5,029
- 4
- 43
- 73
4
votes
0 answers
Directory not empty @ dir_s_rmdir Paperclip
I want to implement disable_with in my submit button so I do it like this:
My view:
= simple_form_for(@user, :url => update_profile_path, :method => :patch) do |f|
= f.input :avatar
= f.button :button, "Update".html_safe, data: {disable_with:…

Bagus Trihatmaja
- 805
- 1
- 9
- 26
3
votes
1 answer
jQuery conflict on Rails
My application.js:
//= require rails-ujs
//= require jquery
//= require activestorage
//= require turbolinks
//= require bootstrap-sprockets
//= require flatpickr.min
//= require_tree .
My Gemfile:
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>=…

fabdurso
- 2,366
- 5
- 29
- 55
2
votes
1 answer
Rails `link_to` with `method` parameter gives 404 when open in new tab
Using Ruby 2.5.1/Rails 5.2.4.1 I generated a new Rails app, and edited/created the following files:
# config/routes.rb
Rails.application.routes.draw do
root 'some#home'
post 'foo' => 'some#foo'
end
# app/controllers/some_controller.rb
class…

Bob Whitelock
- 167
- 3
- 12
1
vote
2 answers
JS and jQuery event listeners do not work upon page load
I am trying to add some simple event listeners to some buttons. I am running Rails 5.2.0 and using the jQuery rails gem. Per the documentation, I added the gem to my gemfile, bundle installed, and required it in the application.js. The event…

michjo
- 407
- 2
- 17
1
vote
0 answers
jQuery Rails Nested Resources Bug?
I have a Rails app using a form with several nested resources in it. The weird quirk about it is I am using several single select inputs as one multiple select input (i.e. Using the same name across them). I am also submitting this via JavaScript…

Ryan K
- 3,985
- 4
- 39
- 42
1
vote
1 answer
How do I specify jQuery version using Rails defaults and bower?
My rails4 app uses Bower to manage front end dependencies. The only js not managed by Bower was jQuery as it was included by Rails by default through the jquery-rails gem.
"Suddenly" my dev environment stopped working because after some updates,…

masciugo
- 1,113
- 11
- 19
1
vote
1 answer
Same list of entries coming railscasts tokeninput
I am using railscasts tokeninput plugin for automcomplete. I want that only those entries shown in dropdown list which are not included in input field
My JS code is
$(function() {
$("#category").tokenInput("/products/product_categories.json", {
…

Haseeb Ahmad
- 7,914
- 12
- 55
- 133
1
vote
0 answers
Rails 3.2 assets pipeline compiles different versions of jquery in production vs development
I have a Rails 3.2 app, in development environment all is ok, while in production (passenger/apache2) I have strange problems with javascript.
My gemfile is:
source 'https://rubygems.org'
gem 'rails', '3.2.13'
gem 'sqlite3', :platforms =>…

kranz
- 599
- 1
- 6
- 23
1
vote
1 answer
Bundler could not find compatible versions for gem "thor", but it doesn't make any sense
When I run bundle update yesterday, it run without any problems, but today I'm getting this error:
Bundler could not find compatible versions for gem "thor":
In Gemfile:
rails (~> 3.2.17) ruby depends on
railties (= 3.2.17) ruby depends…

Pablo Fernandez
- 279,434
- 135
- 377
- 622
0
votes
1 answer
Sometimes link_to with delete method or data-confirm does not work
Rails link_to code: <%= link_to "".html_safe, resource_path(id: id), method: :delete, data: { confirm: "Are you sure...?" }, class: "text-center dropdown-item text-danger bg-light-danger", title: "Delete"%>
Html version…
0
votes
0 answers
A single `remote: true` form tag will not generate requests as type: `js` in my rails app
Basically I can't get a form with remote: true to submit as an xhr request.
It's been a long time since I've worked with a html.erb and js.erb based front end so I'm probably doing something dumb here
Using Ruby 2.5.7 and rails 4.2.11 and I'm using…

Andrew
- 942
- 10
- 26
0
votes
1 answer
Rails 5.0 and JQuery .dialog() Not Working
I'm upgrading a rails app from 4.2 to 5.0. The ruby version is 2.6.4
The app has a view that allows the user to click a link to run a scheduling script that assigns students into courses/classes. The script can take several minutes to run to…

John Cowan
- 1,452
- 5
- 25
- 39
0
votes
0 answers
Uncaught ReferenceError: Modal is not defined after updating to rails 3.2.22.5
I am upgrading rails 3.1.0 application to rails 3.2.22.5. We have used backbone-rails for front-end rendering.
Before upgrading, everything was working fine. But, after upgrading the rails version to 3.2.22.5. We are getting a lot of errors of…

Sarwan Kumar
- 1,283
- 9
- 24
0
votes
0 answers
How to fix jquery-ui rails autocomplete error(turbolinks:load) in rails
I'm working on autocomplete part in rails. I am using 'jquery-ui-rails' gem. while using $(document).ready it is working but it I use $( document ).on('turbolinks:load', function() {} it is not working because of materialize-sprockets.
If I remove…

b2j
- 21
- 6