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
40
questions
0
votes
0
answers
9
views
Rails: Extended class that calls another extended class
Setup:
We got an initializer (in config/initializers) that requires a file where we define our extensions.
This file does something like this:
module UbiquoExtensions
end
:SomeClass.include!(...
0
votes
1
answer
19
views
Can I pass an argument and sort using ransack
"I want to display the exact ID at the top when searching.
For example:
select *
from user
order by user.id = 25 DESC, created_at DESC;
How can I implement this using ransack?"
0
votes
0
answers
15
views
HABTM relationship / validates associated: valid? is true even though I don't think it is
I made the following join table to be used in a HABTM relationship between tasks and itself:
create_table :tasks_tasks, id: false do |t|
t.belongs_to(
:dropoff_task,
null: false,
...
0
votes
0
answers
8
views
Issue with rails hotwire trix textarea resize
im trying to create a textarea resize grippie more or less like the SO for a trix textarea with rais stimulus so i set this controller below
the issue is when i pull down the textarea the textarea ...
0
votes
0
answers
17
views
RPush sending APNs 403/InvalidProviderToken
recently I'm struggling with adding APNs feature to my Ruby on Rails(7) project using RPush. I made some wrong config before and that lead to a failed launch of rails s, then I found and fixed it so I ...
0
votes
1
answer
50
views
Model VS Active record in ROR
Can somebody please explain me the difference between model and active record in simple words ?
Is active model and model same ?
PS: Knowledge regarding these topics will be appreciated.
I am newbie ...
0
votes
1
answer
30
views
Why can't I wrap Sidekiq.configure_server in Rails after_initialize?
After upgrade to Rails 6 the initializers/sidekiq.rb is causing deprecation warnings about class autoloading. As a workaround I thought I could wrap the contents of Sidekiq.configure_server in Rails....
0
votes
0
answers
19
views
Ruby on Rails throws LoadError: Unable to autoload constant for one job, but not for the second [duplicate]
My code triggers two Sidekiq jobs called ExcelImportReconcileWorker with different arguments. The worker creates a new instance of a Parsers::ExcelImport class and runs a method in it. Every time ...
0
votes
0
answers
38
views
Rails: problem with "@hotwired/turbo-rails" and redirects
// app/javascript/application.js
import "@hotwired/turbo-rails"
import "controllers"
import "trix"
import "@rails/actiontext"
import Rails from "@rails/ujs&...
0
votes
0
answers
13
views
Ruby/Rails Bunny RabbitMQ Must be one of [:method, :headers, :body, :heartbeat]
I get an error when trying to connect to RabbitMQ.
Error backtrace:
.../amq-protocol-2.3.2/lib/amq/protocol/frame.rb:67:in `decode_header'
Error:
Must be one of [:method, :headers, :body, :heartbeat]
...
0
votes
0
answers
31
views
How to delete cookies in Rails 7.1?
I recently upgraded my Rails app from version 7.0.4.3 to version 7.1.3.4 and cookies.delete stopped working.
I'm setting a cookie in JavaScript with:
document.cookie = `last_guess=value; path=/`;
...
1
vote
1
answer
47
views
Rails Custom Middleware not being recognized in GH CI
I'm using custom middle ware for the first time to normalize error handling. I have my middleware defined in app/middleware/error_handler.rb and using in my main application.rb
...
require_relative &...
0
votes
0
answers
35
views
Generate a PG dump when click a button
im creating a rails app (basically a monolith). currently, im creating a new feature, "when i click some button, it download a sql script with db backup".
i understand that i can execute ...
0
votes
0
answers
23
views
Docker, nginx, Rails, Puma. Static files are not served but should be
I tried to migrate from Passenger to Puma in a Rails 5.2 project. This is a Docker setup using nginx to redirect from http to https and forward the requests to the Rails container. I had this set up ...
1
vote
0
answers
28
views
Rails 7.1 Error when reading active record model from redis cache
We have a problem during upgrade Rails from 7.0.8 to 7.1.3.2 with reading AR models from Redis cache.
We have several places where we cache AR models with Redis:
Rails.cache.fetch("key_name")...