Category "ruby-on-rails-6"

After upgrading to Ruby 3, unable to pass multiple arguments to my "initialize" method

I recently upgraded to Rails 6 with Ruby 3. I have this in a controller my_object = MyObject.new(my_object_params, @header) The object “initialize&rdquo

Turbo Drive not intercepting links (but turbo:load event fires)

I'm experimenting with adding Turbo to a Rails 6.1 app. It seems to be loading (see "What I've tried"), but when clicking around the clicks does not seem to be

"Undefined method `build'" when using Rspec + FactoryBotRails

I'm trying this gem called FactoryBotRails. For some reason, when I try it on one of my models unit tests, the following error is thrown. Failure/Error: my_

What is the correct way to update images with has_many_attached in Rails 6

I have a Rails 6 app that uses Active Storage to store multiple images to a model (Activity) with has_many_attached. I don't understand how to append extra im

What is the correct way to update images with has_many_attached in Rails 6

I have a Rails 6 app that uses Active Storage to store multiple images to a model (Activity) with has_many_attached. I don't understand how to append extra im

bundler is complaining about stringio, but I don't even have that in my Gemfile.lock

I’m building a Rails 6.1.4.4 app and trying to start my unicorn server (using a script that calls unicorn on /usr/local/rvm/wrappers/cfs-web/unicorn) and

How to use jqueryUI in a rails 6 or rails 7 alpha engine

I would be grateful if someone could show the exact steps needed to use jquery ui in a rails 6 or rails 7 Alpha 2 engine. I have been unable to get either impor

How to use jqueryUI in a rails 6 or rails 7 alpha engine

I would be grateful if someone could show the exact steps needed to use jquery ui in a rails 6 or rails 7 Alpha 2 engine. I have been unable to get either impor

Why can't I display my ruby on rails app on localhost?

I'm trying to display a very simple app from codecademy and this is the error I'm getting in my browser: PagesController#welcome is missing a template for requ

get or post within ActionCable tests in Rails 6?

I am using a JWT to authenticate my user. So when a user want to connect to the ActionCable server, it does something like this: Get a JWT from REST endpoint:

Getting Jquery and Bootstrap to work with Rails 6

I am a new to rails and struggling to get Jquery and Bootstrap to work with Rails 6. I think it has something to do with switching the app from rails 5 to rails

Create an ActiveRecord::Relation in rails 6 with a different table

I am trying to upgrade partitioned gem in order to use partitioning with Rails 6.1 (I am upgrading an existing Rails application). I have managed to get everyth

How do I drop a foreign key if it exists in Ruby on Rails?

There's a function called index_exists? in ActionRecord, but no foreign_key_exists? on Rails 4.2.7. So when I call remove_foreign_key :parties, :franchise_gr

how to check if has_one exists without loading associated model

I have a simple has_one relationship class User < ApplicationRecord has_one :detail has_many :courses end class Detail < ApplicationRecord belongs_

Namespacing service objects in Rails 6 with Zeitwerk autoloader

Rails 6 switched to Zeitwerk as the default autoloader. Zeitwerk will load all files in the /app folder, eliminating the need for namespacing. That means, a Tes

uninitialized constant Formtastic::I18n::SCOPES

Rails 6.0.1, Puma 4.3.0, Devise 4.7.1, ActiveAdmin 2.4.0, Formtastic 3.1.5. Once again I am creating a Rails application. Created the foundation. A couple of m