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.
337,385
questions
0
votes
0
answers
6
views
Ruby on rails actiontext content does not display
I'm currently learning Ruby on Rails, and for my first project, I'm creating a blog application by following the instructions in this tutorial. However, I've encountered an issue when trying to ...
0
votes
0
answers
13
views
Ruby on Rails Name-spacing Standards
What is currently the standard for namespacing resources in rails.
Request
Food
Clothing
Request::Food
Request::Clothing
I have this models in my app and I encountered some issues with having a ...
0
votes
0
answers
14
views
Cannot create database by using rails migration
I have just faced to problem about using rails db:migrate. The below images show exactly what problem I have faced. [This is the error when I run command rails db:migrate](https://i.stack.imgur.com/...
0
votes
0
answers
9
views
processing a datetime + timezone inputs into UTC with rails
Ruby and rails have many methods to parse datetimes with timezone information, but lack an integrated mechanisms AFAIK to input both simultaneously, which is then compounded by the parsing ...
0
votes
1
answer
24
views
Cannot load database configuration: Is a directory
I bought a course on udemy and the first thing in the course is to open a server with the command rails server the server starts successfully:
PS C:\curso ruby\ruby curso udemy\projeto_udemybasico> ...
0
votes
0
answers
12
views
Rails 5.1: Autoload path is not working even when file present in autoload path
we have a folder called lib in the project folder root and also this in the application.rb
config.autoload_paths += %W(#{config.root}/lib)
but I get a error uninitialized constant ActionView::...
0
votes
2
answers
17
views
Stripe plan update URI::InvalidURIError
I create an update method based on the creation, the only difference is in changing the stripe method, but unfortunately I get an error, although the logic is identical
update_feature_plans_job.rb
...
0
votes
1
answer
20
views
How to route with Devise with subdomains?
I'm working on a Rails apps that uses an app subdomain. For example, if a user visits my application at www.mysite.com and logs in, they should be redirected to app.mysite.com/ (which should be the ...
0
votes
0
answers
10
views
Custom Markers for Mapbox with Mapkick
I'm working on a Rails 7 application where I want to create a map of Stadiums. In my database, I have a "stadiums" table with attributes for longitude, latitude, and an image_data field ...
0
votes
1
answer
14
views
database error schema.rb is not generated
I have looked at some other answers about this and none worked. I am migrating my database and schema.rb is not being generated. I have tried rake db:migrate:reset, rake db:drop db:create db:schema:...
1
vote
2
answers
25
views
Rails server is not starting on MAC M2
I am trying to run a rails app on my Mac M2 but it's always freezes during the puma boot process.
=> Booting Puma
=> Rails 7.0.7.2 application starting in development
=> Run `bin/rails server ...
1
vote
1
answer
21
views
Untangling multiple issues in handling timezones
An application is configured with a timezone that is not UTC. It also sets
config.timezone = 'Bogota'
config.active_record.default_timezone = :local`
The motivation is to have system timestamps set-...
-1
votes
0
answers
16
views
Rails - Implement MagicLink for specific page/route to trigger an action [closed]
Looking for a solution to implement magic links that are part of an email and give access to a user to a specific route/page to trigger an action. I don't want to log in to the user, so the below gems ...
1
vote
0
answers
38
views
NoMethodError (undefined method `expired?' for nil:NilClass): ERROR For Rails 7 API Only OmniAuth using React
I'm in dire help of implementing OAuth in an API-only rails application, with react as Frontend. There's not much documentation available on the internet so I'm having a rough time.
P.S. I did not use ...
-1
votes
2
answers
34
views
check if two strings have similar characters
i have a database model that accepts "first_name" but I want it to accept different versions of the word first name. A user might try to save it by choosing to enter it this way "first ...
0
votes
0
answers
9
views
Rails App - Seed Data Task - ActiveStorage::IntegrityError - Google Cloud Storage
I am trying to populate my Rails (version 7.0.7.2) app with some sample data. Attaching items works perfectly in development, testing, and production via a form/UI however I'd like to be able to reset ...
-1
votes
1
answer
24
views
Configuring ActiveStorage to use S3 via ECS Credentials
I am trying to configure ActiveStorage to use ECS Credentials and can't find any documentation on how to configure it.
Right now I have:
staging:
service: S3
region: "MYREGION"
bucket: ...
-2
votes
0
answers
23
views
Rails - MagicLink for specific page/route [closed]
Looking for a solution to implement magic links that are part of an email and give access to a user to a specific route/page to trigger an action. I don't want to log in to the user, so the below gems ...
1
vote
1
answer
39
views
Stimulus controller not loading
I'm getting this message on my console and I cannot find a solution:
Failed to register controller: search (controllers/search_controller) TypeError: The 'stimulus' specifier was a simple specifier, ...
-1
votes
1
answer
19
views
Getting records of through association
I have the following standard has_many :through association:
class Physician < ApplicationRecord
has_many :appointments
has_many :patients, through: :appointments
end
class Appointment < ...
1
vote
0
answers
17
views
No route matches [GET] error in feature spec for update button routed to PUT
I'm writing a feature test for a Rails 7 application. I'm using RSpec, Capybara, and Capybara-Webkit.
The feature I'm testing archives a record(a developer app) when the user clicks an 'Archive' ...
1
vote
2
answers
33
views
Rails 6.1 | Is there a way to check which associations have already been joined to a scope?
I have a little framework for dynamically constructing queries in rails (v6.1.7.3) based upon a json request from the front-end. As the use-cases keep growing, one thing that has been a bit of a pain ...
0
votes
1
answer
17
views
ROR deployment on EC2
(Backtrace restricted to imported tasks)
cap aborted!
Exception while executing on host 53.45.43.233: rvm exit status: 142
rvm stdout: Please login as the user "ubuntu" rather than the user &...
0
votes
0
answers
53
views
Rails 5.1 .any? and .exists? causes unknown column
I'm working with Rails and have encountered an issue with a model that references a table defined in schema.rb as:
create_table "test_table", primary_key: ["somthing", "...
0
votes
0
answers
18
views
Rail Ajax post to controller action and iterate over in view [closed]
i have a unique combination array that generated in JavaScript based on two input fields, i am passing that combination array to combination action with AJAX POST.
How do i iterate that combination ...
-1
votes
0
answers
21
views
postgresql user insufficienct privileges GRANT unknown command [closed]
I have installed postgresql and access the prompt with sudo -i -u postgres. I used the GRANT ALL with my user kev WITH createdb but the error back is that GRANT is an unknown command. When i use the ...
0
votes
3
answers
30
views
Is it possible to disable deletion of a cached file using the carrierwave uploader?
I have a CarrierWave uploader, I need to disable the deletion of cached files after saving them to the store. To then perform some kind of operation with this cached file and delete it manually.
My ...
1
vote
1
answer
24
views
(Rails) How to create both sides of a friendship from one nested form insert in Rails?
Basically I have a User model, and a Friendship join table to make the Users friends with each other.
class User < ApplicationRecord
has_many :friendships
has_many :friends, through: :...
-1
votes
0
answers
27
views
How to Implement Google Login with Omniauth in a Front-end/Back-end Separated Rails 7 Project?
I'm working on a Rails project with a front-end and back-end separation architecture, and I'm trying to implement Google Login using Omniauth.
version:
ruby 3.1.2
Rails 7.0.4
Angular 14
I've seen many ...
0
votes
2
answers
27
views
How to disable Rails ActionCable WebSocket channel for other Rails app in local env
I'm working on two different Rails apps. On App 1, I created a channel to broadcast changes called "ProductsChannel". I later shut down the server for App 1, and spun up the server for App 2 ...
1
vote
0
answers
20
views
Using the default_url_options and path_params option within an ActionDispatch::IntegrationTest
How do you get an IntegrationTest to use the default_url_options method? I would like to take advantage of the path_params option for url_for.
Here is a simple example:
Rails.application.routes.draw ...
0
votes
0
answers
28
views
I am getting a NoMethodError (undefined method `set_post' for #<PostsController:0x000000000239d8>) in rails 7 [closed]
I am making a social-media application in rails 7 for creating posts.
When I try to see a post i.e: go to the show view of the post, I am getting No Method Error.
The complete error is shown in the ...
0
votes
1
answer
27
views
At what point is validation triggered in the model when saving a file on S3 with Carrierwave and Fog?
There is an ActiveRecode model with a carrierwave uploader. I'm interested in the following question. At what point does validation occur? Before the moment the store method is triggered in the ...
-2
votes
0
answers
23
views
Build fail while deploying ruby application to Heroku server [closed]
I upgraded Heroku server to stack 22 and it needed Ruby 3.1.4 as well the matching rails 7.0.1.
The application running fine in Linux server using (rails s), But getting failure while deploying in ...
0
votes
0
answers
35
views
Why did the Rails team decide to use inheritance over composition for ActiveRecord? [closed]
I am primarily looking for insights surrounding this. I understand that 'convention over configuration' is the mantra, but it doesn't seem clear to me as to why inheritance was used to extend classes ...
0
votes
1
answer
35
views
wrong number of arguments (given 2, expected 1) on = image_tag 'home1.jpg'
I'm upgrading an application from rails 4.2 to 7.0.
I've already upgrade my gems, but when I try to access to localhost it returns an error like
wrong number of arguments (given 2, expected 1)
on line
...
-1
votes
0
answers
22
views
17|Session|No agreement on destination on the rails with Amadeus [closed]
In the provided code and XML request body, I am attempting to make a SOAP API call to Amadeus using the Savon gem (2.14.0) in Ruby on Rails (7.0.7). Let's break down the code and the request:
Savon ...
-4
votes
1
answer
28
views
How to build a job portal bpmn flow chart for job seekers, job providers, platform admins? [closed]
Can someone help me build a job portal bpmn flow chart for job seekers, job providers, platform admins?
I was expecting a pictorial presentation
I need separate figures for every sections I mentioned ...
0
votes
1
answer
46
views
Generate sequential invoice numbers with tenant prefix under concurrency
I have an Invoice model which has a before_create :generate_invoice_number callback.
I also have two tenants for EU (prefix 11) and US (prefix 12). The generated format should be tenant-00000001. For ...
0
votes
0
answers
17
views
Adding Heredoc syntax Highlighting in VSCode
I have a Rails project in which I'm using View Components. Inside most components, I have a erb_template HEREDOC which defines the components markup using ERB templated HTML.
When I set the HEREDOC ...
1
vote
1
answer
38
views
Ruby On Rails - Namespacing Resources
I am encountering an issue in namespacing models in rails.
I have these models in my app
Request
Food
Clothing
Request::Food
Request::Clothing
I passed a namespaced model like Request::Food as an ...
0
votes
0
answers
14
views
How to add OID datatype in rails migration
I have following migration
class MigrationName < ActiveRecord::Migration[6.1]
def up
create_table :my_table_1, if_not_exists: true do |t|
t.string :key, null: false, annotations: { ...
0
votes
0
answers
11
views
Rails 7 app crashes after a few minutes with Aw, Snap! Something went wrong while displaying this page. Error code 5
The app is using esbuild, active_storage with vips, hotwire and stimulus and it's very file heavy in general. Videos, Images, etc...
Recently the app has been consistently crashing after a few minutes ...
0
votes
2
answers
18
views
What gem to use to connect with SQL Server in Rails 7.0.6?
I'am using the Rails 7, but I am not finding the compatible gem to connect with SQL Server, I tried to use activerecord-jdbcmssql-adapter, but is not compatible with rails 7 and JRuby 9.4.x
Can ...
0
votes
1
answer
14
views
How do I add FontAwesome to Vue/Express/hypernova-vue app
The app I'm working on is a Rails app using hypernova-vue to allow Vue3 micro frontend apps/components to be used throughout the site. I've built a small, private npm library of components used by the ...
0
votes
0
answers
13
views
Webpacker won't seem to boot on an https port
I am using Shakapacker, a fork and successor to Webpacker, trying to get it to boot on https for local development, using a nonstandard domain abc.localhost.
This works for Puma by passing it a flag -...
0
votes
0
answers
30
views
Rails Doesn't Recognize ChatGPT API Key [closed]
I have a problem with my ChatGPT Service on Rails. In the service file, I have this:
headers: {
'Content-Type' => 'application/json',
'Authorization' => "Bearer #{...
0
votes
0
answers
74
views
Error when running Google Sheets function using Apps Script API
I am attempting to run a function on a Google Sheet using the Apps Script API in a Ruby on Rails application. The purpose is to execute a function on a Google Sheet, but I'm encountering an error ...
1
vote
2
answers
40
views
Rails 7, return active record association with two separate conditions, one in the parent, one in the child
I have an Applicant model, that has become the location or a chat between a project owner and an applicant to that project.
I track the applicant by using an applicant.user reference in the Applicant ...
0
votes
0
answers
15
views
How to fix `failed to load command: bootsnap (/rails/vendor/bundle/ruby/2.7.0/bin/bootsnap)` while deploying through fly.io
I am trying to deploy a ROR application through fly.io in Ubuntu 22.04. When I try to use fly deploy command I get following error
Terminal Output Here
My Gemfile has following content
# ...