Joel C

Joined

240 Experience
2 Lessons Completed
0 Questions Solved

Activity

Posted in Button Loading Animations with jQuery UJS Discussion

Christoper Drane's solution above is an awesome supplement to Chris' tutorial. I had the same issue - font awesome was not working until after the spinner was cached. I switched to a pure CSS solution per http://stephanwagner.me/only-css-loading-spinner using relative positioning and on a div itself instead of the before pseudo element. Much faster, no hiccups, and works everywhere!

Posted in Sortable Drag and Drop Discussion

Thanks, Chris. Strangely, Rails.ajax doesn't fire an ajax request for me even though $.ajax works fine. I'm using Rails 5.1.5 and I've confirmed the rails-ujs file is included. Good to know about the authenticity token being included in every request with Rails.ajax.

Posted in Sortable Drag and Drop Discussion

A few pretty basic observations/questions:

(1) When I use: 
Rails.ajax
nothing hits the server after the drag/drop is complete. 

I changed to:
$.ajax 
and that fixed the problem. Any ideas why the former did not work and the latter did?

(2) Instead of 
//= require jquery-ui/widget
//= require jquery-ui/sortable

I needed to use
//= require jquery-ui/widgets/sortable
to avoid an error message. I suspect this has something to do with either (a) a new version of jquery-ui or (b) my lack of understanding of the asset pipeline.

(3) My implementation required me to the skip authenticity token on the sort method with:
skip_before_action :verify_authenticity_token, only: [:sort]

How does the code in this tutorial work without skipping the authenticity token verification?

Thanks, as always, for such wonderful tutorials!

Posted in How to send Webhook?

+1 for a webcast on sending webhooks.

logo Created with Sketch.

Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

© 2020 GoRails, LLC. All rights reserved.