ruby-on-rails Questions

3

On the project the console ceased to be started, I tried everything that found in Google.. I run rails c and get an error: /Users/gorbunov/.rvm/gems/ruby-2.4.1/gems/railties-5.2.0/lib/rails/railt...
Intervention asked 22/6, 2018 at 8:55

1

I am trying to upload a file in rspec and use that file in my controller. Everything worked fine in Rails 4 but now in Rails 6, the Rack::Test::UploadedFile hash when received in controller, my tem...
Hodgkins asked 22/1, 2020 at 4:39

4

I just got a new M3 running Sonoma, and I'm experiencing the following error running bundle: An error occurred while installing nio4r (2.5.8), and Bundler cannot continue. Make sure that `gem insta...
Coakley asked 12/4 at 0:19

7

Solved

I am using Rails 3. There is a possible duplicate here. But it did not solve my problem, neither did any other solution. My migration is as follows class AddConfirmableToDevise < ActiveRecord:...
Phyla asked 2/2, 2012 at 7:16

4

I would like my background jobs to run inline for certain marked tests. I can do it by wrapping the test with perform_enqueued do but I'd like to just be able to tag them with metadata and it happe...
Neocolonialism asked 17/5, 2016 at 16:24

2

I have a Rails 7 application. After some development I see that Turbo (Hotwired) creates too many issues and I don't need it for this application. Is there any way to remove Turbo completely from a...
Professionalize asked 14/1, 2022 at 18:14

2

Solved

I'm working on an application with 731 tests, and if 6 fail, I have to scroll through 731 lines to try and spot each failure so I can fix the problems. Is there a way for minitest to print all the ...
Carbamidine asked 21/8, 2020 at 5:46

5

I am working with ActiveAdmin and need to make customizations to some views and have come across a couple of scenarios I feel I am doing wrong. I am adding an additional table to a show view (comm...
Stonechat asked 22/7, 2012 at 6:9

4

I've been round and round here with trying to get the assets to pre-compile on my production server (straightforward ubuntu install with ruby 1.9.2 and Rails 3.1.1, and tried 3.1.2RC with the new s...

2

Solved

I'm using Rails again after a few years away (last used Rails 4). I have multiple stimulus controllers that reference a file called metric_defaults.js. That file just contains a flat set of definit...
Unattached asked 27/4, 2023 at 3:3

2

Solved

I have a fat multi-tenant Rails app on Apache + mod_passenger that outputs product prices from a PostgreSQL table as follows: Table "public.products" Column | Type id | bigint name | character var...
Nursemaid asked 27/9, 2018 at 13:18

4

Solved

I know Rails does this for you, but I have a need to do this myself for examples. Is there a simple, non-private method available that takes a string and returns the hash of params exactly as Rails...
Madrigalist asked 12/3, 2015 at 6:3

8

Solved

I can do this to check if a record(s) exists (say id "1" exists, but "2" and "3" don't): Model.exists?(:id => [1, 2, 3]) #=> true How do I do the opposite, so: Model.not_exists?(:id =>...
Bluecollar asked 1/12, 2010 at 16:28

7

Solved

I'm working on getting a new Rails 7 project deployed to production (trying on both Heroku and Render.com) and am getting the following error during build: $ tailwindcss -i ./app/assets/stylesheets...

11

I'm trying to use rails 4.2.6 to develop an app. I'm trying to use postgres for database. Server starts fine but when I try loading a page it throws this "No connection pool for ActiveRecord::Base"...
Nowt asked 4/7, 2016 at 2:50

6

Solved

Rails has built in log filtering so you don't log passwords and credit cards. Works great for that but when you want to trigger a custom log (like to email) and send your own params or other data a...
Powe asked 29/8, 2011 at 15:56

3

Solved

my stored procedure in MySQL fails with Mysql::Error: Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for operation '='. The procedure fails when in SELECT clau...
Chalcopyrite asked 7/12, 2010 at 11:6

9

I declare a model with an enum type like: class Event < ActiveRecord::Base enum event_type: { "special_event" => 0, "pto" => 1, "hospitality" => 2, "classroom" => 3 } Then in...
Careful asked 14/8, 2014 at 21:4

14

Solved

I am struggling to push my code to Heroku. And after searching on Google and Stack Overflow questions, I have not been able to find the solution. Here is What I get when I try "git push heroku mast...
Mantilla asked 1/1, 2011 at 13:24

3

I have a new app that I am trying to setup with devise and devise-jwt. For some reason my authenticate_user! call is causing an error because sessions have been disabled: {"status":500,&...
Ploss asked 25/8, 2022 at 12:10

4

Solved

I have a strange bundle update issue with the dependency of net-pop. I manually updated all gems via bundle update GEM. Everything works so far. My CI builds and tests jobs are green. But: When I n...
Allyson asked 13/6 at 10:59

2

Solved

I have a Stimulus controller # app/javascript/controllers/clubs_controller.js // handles micropost javascripts import { Controller } from "stimulus" import Rails from '@rails/ujs'; export...
Shavian asked 20/9, 2020 at 7:11

3

Solved

I'm using Rails polymorphic associations, that way some models have many cash_histories children, like this: has_many :cash_histories, as: :cashable But when I try to delete all cash histories f...

3

The turbo:load event is not fired after a turbo visit (as the documentation says it should). It works as expected after the initial full-page load. I can catch the "turbo:before-fetch-response...
Peursem asked 9/2, 2022 at 0:26

6

Solved

I made an app in Ruby on Rails and now I want to get it hosted. However, they require that I use MySQL and I set it up using sqLite3. Is there any way to convert it to use MySQL?
Dorsey asked 3/11, 2009 at 21:10

© 2022 - 2024 — McMap. All rights reserved.