Questions tagged [ruby-on-rails]
Ruby on Rails is an open source full-stack web application framework written in Ruby. It follows the popular MVC framework model and is known for its "convention over configuration" approach to application development.
ruby-on-rails
88,823
questions with no upvoted or accepted answers
42
votes
1
answer
1k
views
Typekit and @fontface issues on all Windows browsers with Ruby on Rails app, especially Chrome
My Ruby on Rails app hates custom fonts and I don't know why. Here are some of the errors and troubleshooting that I have gone through.
First, there were devastating display errors that only happened ...
25
votes
1
answer
3k
views
Rails Activestorage + DirectUpload javascript progress bar not showing when using "remote:true"
I have been using Rails ActiveStorage DirectUpload in my Rails app. And here is the code of the form:
<h3>Select Files To Upload</h3>
<%= form_for @uploader, url: uploaders_file_path(@...
18
votes
2
answers
1k
views
Profiling slow assets in development
Every time I make a change to my SASS in development, I get 20s+ load times when loading my application.css.
I've read some other questions, and tried:
Setting config.assets.debug = false.
Changing ...
16
votes
1
answer
819
views
Debugging Rspec Postgres lockups
I am trying to test an app that uses gem devise_token_auth, which basically includes a couple extra DB read/writes on almost every request (to verify and update user access tokens).
Everything is ...
15
votes
4
answers
1k
views
Fragment caching and eager loading: How to get the best of both worlds?
It seems to me that fragment caching and eager loading are -- at least sometimes -- somewhat at odds with each other. Let's say I have a User who has many posts which each has many comments which in ...
14
votes
1
answer
962
views
MongoDB conditional aggregate query on a HABTM relationship (Mongoid, RoR)?
Rails 4.2.5, Mongoid 5.1.0
I have three models - Mailbox, Communication, and Message.
mailbox.rb
class Mailbox
include Mongoid::Document
belongs_to :user
has_many :communications
end
...
14
votes
1
answer
1k
views
Measuring rails json api with rack mini profiler
How do we get rack-mini-profiler to show in a rails json api? I believe this was asked here: How to profile a rails controller that returns a json response with rack-mini-profiler? but the only answer ...
13
votes
1
answer
972
views
How to encrypt a file using PGP encryption in jruby9.1.2.0?
I am trying to encrypt file using gpg encryption before sending it in my jruby project. However I did not find adequate resources for it. I tried using ruby-gpgme but jruby did not support C libraries....
13
votes
1
answer
4k
views
Rails5 + ActionCable: WebSocket connection to 'ws://{hostname}/cable' failed: WebSocket is closed before the connection is established
I get WebSocket connection to 'ws://{hostname}/cable' failed: WebSocket is closed before the connection is established. in my chrome browser when connecting to my Rails 5 + ActionCable app. In my ...
13
votes
1
answer
553
views
Setup issue in CAS Server in Rails 3.x
I have installed rubyCAS Server on ec2 server, using Rails 3.2 and Ruby 1.9.3 and configured configure.yml file, my
server: webrick
port: 9292
ssl_cert: /mnt/rubyonrails/testingcas.pem
Note:
I ...
13
votes
1
answer
2k
views
recreate versions - carrierwave-fog-aws
I'm trying to recreate the images that I have uploaded using the following in my model...
Post.all.each do |ym|
ym.avatar.cache_stored_file!
ym.avatar.retrieve_from_cache!(ym.avatar....
13
votes
1
answer
2k
views
Paperclip/Rspec tests: Is there a faster way to test paperclip validates_attachment_content_type?
One thing I've noticed is that in most of the projects I do, the one spec that always takes a long time (30 seconds +) is this shoulda/paperclip helper:
it { should validate_attachment_content_type(:...
13
votes
2
answers
488
views
Ruby on Rails Less source maps and the asset pipeline?
I'm currently using the less-rails gem in a Ruby on Rails application that I'm building. I would like some way to debug my Less css files in Chrome by way of source maps (https://developers.google.com/...
12
votes
1
answer
2k
views
Rails + Webpacker + React.js / Cannot find module
I'm learning React.js with Rails 4.2 (to prepare to work on it) but I have a lot of errors in my console.
So I'm using React 16.8 (with react-rails gem) + Rails 4.2 + Webpacker 4.0.2
My folders ...
12
votes
1
answer
626
views
Ruby on Rails Gon Gem vs. cookies or regular AJAX request
I've been programming on Ruby on Rails for a while now, and to be able to easily access data from my controllers in my javascript code, as a beginner I came across the Gon Gem. It solves the problem ...