Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

414
Views
Error de referencia no capturado: $ no está definido ruby-on-rails

Intenté leer jquery pero no funcionó. Quiero ocultar el botón de descarga y cancelación una vez que los usuarios hacen clic en el botón de descarga y mostrar el botón Atrás.

Este es un error cuando ejecuto.

Error de referencia no capturado: $ no está definido

Esto es show.html.erb

 <button class="btn btn-primary" type="submit" id="download_button"><%= t(".download") %></button> <%= link_to t("cancel"), certs_path, class: "btn btn-default", id: "cancel_button" %> <%= link_to t("back"), certs_path, class: "btn btn-default", id: "back_button", style: "display:none;" %> .... <!-- After downloading the certificate, prevent the button from being pressed to prevent certs re-creation. --> <script> $("#download_button").on("click", () => { $("#download_button").hide() $("#cancel_button").hide(); $("#back_button").show(); }); </script>

Esto es config/webpack/environment/js

 const { environment } = require('@rails/webpacker') const webpack = require('webpack') environment.plugins.prepend('Provide', new webpack.ProvidePlugin({ $: 'admin-lte/plugins/jquery/jquery', jQuery: 'admin-lte/plugins/jquery/jquery', }) ) module.exports = environment

Esta es app/assets/javascipts/application.js

 //= require jquery //= require_tree .

También probé rails s y la bundle update pero no funcionó.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!