All Questions
719 questions
0votes
1answer
36views
how put an id unique in a button in a rails loop?
I have a grid where the receipts are listed with their information and the display button. The idea is that pressing the button that appears in the actions column (button_tag) sends the information of ...
0votes
1answer
88views
Rails: How to set Namespace CoffeeScript so a script is only called on given page(s)
I'm calling a Java/coffescript function, typehandler (not shown), repeatedly with slightly different parameters. This is happening on EVERY page load for the application. It really only needs to ...
0votes
1answer
296views
Show if a form hidden field based on the value of the object, rails
I'm a learning programmer that only know Ruby on Rails and I know nothing of Javascript. I have a form in ruby on rails that creates a object Unit. The model Unit belong to Category that in turn ...
4votes
3answers
873views
how add coffeescript in svelte on Rails 7?
I have a Rails 7 app with esbuild : esbuild.config.js : #!/usr/bin/env node const watch = process.argv.includes("--watch"); const esbuild = require('esbuild') const ...
17votes
1answer
28kviews
JQuery .on() isn't binding click events to dynamically created elements [duplicate]
I have a textbox that dynamically adds an element when I press enter, and another that deletes the element when I click the delete button. The delete method works for any existing elements, but doesn'...
2votes
1answer
1kviews
rails remove element in real time
Got a link that removes a message from the current_users screen: = link_to '[x]', msg, method: :delete, remote: true, class: "del-link" It triggers this coffeescript-funktion: delete_message = () -&...
1vote
1answer
123views
errors creating a custom web component with coffeescript
I am trying to create a custom HTML5 web component in a Rails application, but I am getting errors instantiating the Javascript object. Version info: Rails 4.2.11.3 ruby 2.5.8 coffee-rails 4.1.1 I've ...
1vote
1answer
179views
how can put ruby tag with javascript (coffescript)?
I am working with ruby on rails (rails 4.2). Given a validation done in javascript I need to run a ruby tag or not. I found something similar here but it didn't work for me. html: <div id="...
0votes
1answer
94views
Dropzone Rails Gem How to Send with 0 Files
I want to know the right way on how I handle still sending even when I have 0 files uploaded. I have a form that has a lot of data to input and the images are optional. I could probably send this with ...
0votes
2answers
2kviews
Turbolinks, Rails, back button, footer from other source
I have an issue with turbolinks. When I click a 'back' button in browser there is one more footer appends. In application.html.slim: doctype html html head title - unless content_for(:...
0votes
1answer
194views
Add parameters while submitting a form in rails6
Can I add additional parameters to the below submit function without adding hidden_fields in the form and ajax in rails6 $("#product_form").submit() Please help. Thanks
1vote
2answers
4kviews
Rails datatables select filter
I have an ajax datatable for my SKUs. For this I am using the ajax-datatables-rails gem. Searcing and sorting works perfectly, but now I'm trying to add a filtering function to my table and it doesn't ...
0votes
1answer
282views
How to check syntax error in coffeescript
I am not familiar with coffee script, I try to move jquery from view to put in asset but not able to make it work. Here the working from view: - jquery_ready do $('label[for=voucher_name], input#...
1vote
4answers
3kviews
Rails 5.1: How to override confirmation dialog with bootstrap using rails-ujs
Prior to Rails 5.1 I was able to use the following to customize the confirmation dialog using bootstrap styling: $ -> $.rails.allowAction = (link) -> return true unless link.attr('data-...
2votes
3answers
4kviews
How do you get JQuery to work with Rails 6 and Webpacker 6
I really cant believe that getting JQuery to work with Rails 6 and Webpacker 6 can be so hard. Suggestions in Rails 6: How to add jquery-ui through webpacker? don't appear to have worked but hard to ...