Category "ruby-on-rails"

Why are tests failing in Ruby on Rails?

I am studying the book "Agile Web Development with Rails 4". In it, at one moment associated with testing, it gives two errors Error: ProductsControllerTest#tes

Create grandchildren associations in the same Rails model

I want to get something like this in one class using ActiveRecord: grandfather = Person.create(name: "Grandfather") son = Person.create(name: "Son", parent: gr

rails new cssbundling-rails gem issue with images on production

I'm testing the new rails cssbundling-rails gem. I'm following the default config, but on prod, I'm getting a 404 error with the images path in the .scss files

How do I troubleshoot "wrong number of arguments" in solidus affirm

Struggling to get solidus_affirm working and hoping anyone might have some ideas. I always have trouble with "wrong number of arguments" errors like this. Can g

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

RoR App: “The asset 'application.css' is not present in the asset pipeline”

Info: Rails 6.1.4 Ruby 3.0.1 PostgreSQL 9.6 NodeJS 11.15.0 Yarn 1.22.5 when I start my APP I always got the same error: I've tried all I saw in others posts bu

Rails - a way to check the last line while using smarter_csv gem

I am using smarter_csv gem to parse a large CSV file on Heroku. SmarterCSV.process(file_name, { chunk_size: 10, headers_in_file: false, user_provided_headers: u

Gem to local libray in Rails

My boss asked me to write a gem to wrap an API (canvas) consumer for our app, I did it and it works, but in the last minute he asked me not to use the gem appro

rspec describe a rake task namespace

I want to test a specific namespace of rake tasks and I am getting an error from rubocop. desc 'This namespace is test' namespace :test_namespace do task tes

Login with devise-jwt authentication?

I cannot figure out how to send a post request to login on devise with devise-jwt I use devise as web authentication, but want to add an endpoint for api authen

Rails: Webpacker::Manifest::MissingEntryError in Home#index

Webpacker::Manifest::MissingEntryError in Home#index Showing /Users/khalidhosein/Desktop/myEPKmedia/builder/khalid101/app/views/layouts/embedded_app.html.er

Rails: Webpacker::Manifest::MissingEntryError in Home#index

Webpacker::Manifest::MissingEntryError in Home#index Showing /Users/khalidhosein/Desktop/myEPKmedia/builder/khalid101/app/views/layouts/embedded_app.html.er

RailsTutorial 13 --- Image doesn't show on the web page after uploading it through AWS S3

I am a newbie and just started to learn coding with RailsTutorial. I use AWS C9 Ubuntu as is instructed. At the end of chapter 13, there is an instruction for A

Rails Remote True Ajax ActionController::UnknownFormat

I have a mini-update method in my model that only updates one field, set up in a chart (so I see the form for each row). It works properly, but want it to upda

How to pre-fill arguments to a function in Ruby?

Let's say I have a function foo: def foo(A, B, C) A + B + C end And I call it like this, with only the last parameter changing: foo("foo", "bar", "123") foo("

How to display icon with openweather api in rails app

I tried to display icon with openweather api. It work this _else.html.erb . . <div class="tenki"> <h2>Tokyo</h2> <img src="http:

Open a new terminal tab and run a command inside, only after open tab

I'm trying to create a script to open a new tab at my rails project and run rails s inside this tab, to already start my server. My command: xfce4-terminal --ta

HTTP Error 418 (Teapot Error) on Link to FlightRadar24 When Server on Localhost

I am writing a Rails web application that presents OurAirports airport data to the user. One convenience I provide is a link to the FlightRadar24 web site for t

FOREIGN KEY ON DELETE SET NULL in rails

I'm working with two models in rails class Student < ApplicationRecord belongs_to :school has_many :lessons end and class Lesson

byebug isn't displaying the output as I type

I've experienced an odd interface glitch. [44, 53] in /document.rb 44: code 45: code 46: 47: def code 48: byebug => 49: