Category "ruby-on-rails"

Rails nokogiri XML create

In ruby on rails i use Nokogiri to create XML files. Now I want to create a XML line like this: <mis:actions param="-900" accuracy="1" cameraIndex="0" payloa

What is `null false` in mutations graphQL rails?

module Mutations class BaseMutation < GraphQL::Schema::Mutation null false # <---- what is this? end end In a lot of classes, I see this function

bin/rails console doesn't start

I'm new to Rails & Ruby in general. I was following this guide and got stuck on step 6.3. my bin/rails console result in error below /home/gaura/.local/shar

ERROR: While executing gem ... (Gem::Exception) OpenSSL is not available

I get this openssl error when trying to install/update any gem, although I have openSSL installed through brew install openssl. This can be frustrating but ther

Rails validation error message not showing

I am trying to add a custom error message for my model validation. Seen below: validates :cost, numericality: { greater_than_or_equal_to: 0, message: :custom_er

How can I control daisyUI tailwind modal open as default

I set daisyUI but not figure out how to control modal by condition I think similar with flowbite or bootstrap https://flowbite.com/docs/components/modal/ but da

Database management tasks definition for multiple db in a remote connection context

This section of the rails guides states: If you would like to connect to an external database without any database management tasks such as schema management, m

Database management tasks definition for multiple db in a remote connection context

This section of the rails guides states: If you would like to connect to an external database without any database management tasks such as schema management, m

Can we upload files to AWS S3 and Google Cloud Storage simultaneously using CarrierWave gem?

One of my Model's attachments needs to save files on AWS S3 and the other Model should save it to Google Cloud Storage. Is this possible using CarrierWave gem?

Facebook Marketing API create Ad Creatives Error

I'm having issues creating Ad Creatives using: gem 'facebookbusiness' Facebook API version 13.0 I have successfully managed to upload Ad Images and to get the

How to get all embeds_many items in Mongoid

I'm Using Mongoid and I have two models: class User include Mongoid::Document include Mongoid::Timestamps embeds_many :tickets field :email, type: Str

bootstrap 5 on rails 6 (justify-content-center)

I am a newbie here, please avoid complex answers :) A row was created to center all of its content, it worked just fine. The form submit button and the link_to

How to order a query by translated attribute of associated model in Rails using Mobility gem

I've two associated models: class Food < ApplicationRecord extend Mobility belongs_to :food_set, inverse_of: :foods translates :name, type: :string,

Rubocop – how can I just display auto-correctable results

I would like to run Rubocop and just see auto-correctable results. The documentation (https://docs.rubocop.org/rubocop/usage/basic_usage.html) indicates this sh

How to assign an instance to a variable - .find() / .where() - and access it's values - RUBY on RAILS

account = Account.find(params[:account_id]) account_to_receive = Account.where(number_account: transaction.account_to_transfer) So I am building a bank app I wo

Warnings when upgrading application from Rails 5 to Rails 7

with a recent upgrade to rails 7.0.2 from rails 5.2, when ever i start a rails console or a rails server on dev mode i see these warnings /Users/opensource/.rvm

How to import JS files with esbuild & jsbundling-rails

I'm moving a Rails 6 app from webpack & webpacker to esbuild & jsbundling-rails I can't find any documentation on the correct way to import custom js fi

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