Category "ruby-on-rails"

problems to run rails s on Rails 4 :S

Im trying to run s on my project in Rails 4.2.2 but i get a unexpected error :S Someone know the reason of the error? Thanks in advance This is my logs ....

Rails App Breaks with 404 Error when Last.fm API Call Returns Nothing

I wonder if anyone can help, and if the issue is specific to Last.fm (perhaps not the greatest of APIs). I've built an album search feature into my app that tak

Rails 7 Dynamic Nested Forms with hotwire/turbo frames?

I'm very new to the rails. I've started right from rails7 so there is still very little information regarding my problem. Here is what i have: app/models/cockta

Remote form refresh the page on submit

I am trying to add some ajax and work with remote forms on my rails 7 app. I added local: false but the form still rerenders the page instead of just sending a

I am trying to create a post in instagram clone in ruby and rails but it throws an error "no implicit conversion of Integer into string"

This is the Post Model class Post < ApplicationRecord mount_uploader :image, ImageUploader scope :active, -> { where active: true } end This is

Whats missing on my Ruby 'Inverse Of' relationship

I know this topic has been addressed, but I have been at this for 2 days and I'm just stuck. I know inverse of does not create a new query, so should I use anot

Ruby : Cannot load such file --ruby2d (LoadError)

I'm new to Ruby,Writing some code to make a game,so using ruby2d library. Got an error while writing some basic code. Help me out Folks. require 'ruby2d' set ba

how to update local gem's github token

I have locally installed gems with github address. When I want to update that gems with bundler, it tries to clone repository with an old access token. How can

gem install rails on git bash (for Windows)

gem install rails ERROR: Error installing rails: ERROR: Failed to build gem native extension. current directory: C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/websock

How to create a SQL date range query where the date range depends on holidays and weekends?

I would like fetch all records in Postgres that match a particular date range. The column 'date' is of type Date. Return all rows where date is tomorrow's date

Issues regarding the 'rails new' command

I am encountering issues when creating a new application on Ruby On Rails. Whenever I get create a new application on Ruby on Rails, my file was not created suc

Rails - StimulusJS: how to set target value from within setTimeout?

In my Rails-Stimulus controller, I fetch data in a loop from a function in which I've setTimeout. How do I set the target value from within the setTimeout? My f

Ruby on Rails CSRF token creation

The code to create a CSRF token in Ruby on Rails is: def mask_token(raw_token) # :doc: one_time_pad = SecureRandom.random_bytes(AUTHENTICITY_TOKEN

after_commit and after_destroy callbacks are not called on ActiveRecord::Relation delete_by method

I am using ActiveRecord::Relation delete_by method to delete a record but this is not triggering after_commit and after_destroy callbacks. See below example: cl

Why am I getting a nil value from a Ruby object's member, when it is not nil? [closed]

I want to get the value of a field (ScenarioID) in a Ruby ActivityChart object (chart). Displaying the whole chart shows the value I want: 16

React / Rails / I18next change language in URL or refresh server-side props

I'm using React with Rails. I get some props from a React controller when rendering the page initially. When changing the language on the frontend (I18next), we

Rails 5.2 load order breaks db:create

I have a rails application that on Rails 5.1 had no troubles creating MySQL db schemas but fails to create after upgrading to Rails 5.2. It seems like with 5.2

clean way to read out id in a request path in ruby on rails

I have a request that comes in like this: api/v1/photos/1/media/2 "1" and "2" are ids I need to read out in the controller. "2" I can get through the parameters

Login flow with Hotwire

I'm currently developing my first application with Rails and Hotwire. It includes a comment form visible to all users. When unauthenticated users submit it, I'd

How to use and load JS helpers in Stimulus controllers in Rails 7?

I want to import and use functions from my javascript/helpers/functions.js file in my stimulus controllers. I tried pinning it with: # importmap.rb pin_all_from