Category "ruby-on-rails"

Rails app: I am having trouble creating joint instance

I want to create a simple app where admins can post their job offers and regular users can apply to those job offers. For that I have created a joint table: My

Unable to auto-format *.rb in setting.json below in VScode

I want to auto-format all html, css, sass, rb, and html.erb,js files with setting.json_Vs-code. But the next file after setting.json can only be the above *.rb

Ruby NoMethodError: undefined method

I am using rack-reducer with rails. I am getting the error: #<NoMethodError: undefined method 'order_from_user_input' for #<DataPoint::ActiveRecord_Relati

How to send a POST request with after create or update of a user (RAILS)

This is my first time working with Requests and i'm a little confused, any guidance would be greatly appreciated. Task: after a user is created i would like to

How to access nested attribute in Rails Sql

I have the following Alert object that looks like this: <Alert id:1, message: "{\"body\": "\This is a test.\"}" > I'm trying filter the body content f

How to search nested hash of arrays and arrays of hash and return multiple matching objects from the parent node?

Say I have the below ruby hash nested hash_or_array = [{ "book1" => "buyer1", "book2" => { "book21" => "buyer21", "book22" => ["buyer23", "b

How to capture record versions by PaperTrail on bulk insert in Ruby on Rails?

I use Paper Trail gem to capture versions of my models and it works very nicely. But Paper Trail don't capture version on bulk insert. Example: User.bulk_import

Generating files in Docker vs. Docker Compose

I am learning Docker and have a little confusion that I would greatly appreciate some advice on. When creating a new rails application. Following the guidelines

Cannot Install gem stackprof on ruby 2.4.10 on Macbook M1

I am trying to bundle install my application. I have the gem stackprof and i keep getting this error whenever i try to install this gem. I am using M1 with Ruby

cannot load such file -- mysql2/mysql2

I am doing the installation on m1 mac and I am stuck mysql issue. my rails server is working fine but when I run my spec then I got cannot load such file -- m

Getting 500 Internal Server Error while trying to send an email using Mailgun in Heroku , using Rails 7 and mail_form

I was following this tutorial right here https://gist.github.com/stevecondylios/16a53b73f22621e3cde2e17096dbf5ca Which teaches you how to make a simple contact

Monitor ActiveRecord records and find patterns

Well, I'll try to be as clear as possible in my problem, and I hope to get answers with Ruby because I'm currently studying Ruby on Rails, but of course other s

turbo_confirm not working in a Rails 7 app with turbo-rails 1.0.1

In a Rails 7 app, I am trying to ask the user to confirm before destroying a resource. In my erb view, I have the following tag: <%= button_to 'Destroy', acc

how to add PSQL user For a Rails app that has full access but can't drop the database

How to configure a PSQL v11.4 user that is not the superuser and does not own the database. This user should have full access to create SQL objects and drop the

Place images on same line [Ruby on Rails]

I have badges that are displayed on profile pages But there is this block of white space that fills in. I am not sure how to position the badges appropriately.

Rubocop: Assignment Branch Condition size for method is too high. How can I reduce the method?

This block of code: def set_conversation @conversation = Conversation.find(params[:conversation_id]) .match.origin_target.

Rails 7 Import Maps - import folder with custom scripts

playing around with Rails 7 and import maps. Trying to import a folder with some custom JS. # config/importmap.rb pin_all_from "app/javascript/custom", under: "

there is any answer for image upload error in rails?

when i upload the i got this error in rails application ActiveSupport::MessageVerifier::InvalidSignature (ActiveSupport::MessageVerifier::InvalidSignature): i

Problems with same query in mongoid rails db but different parameters

I’m using mongoid gem ’mongoid’, ’~> 7.2.4’ (mongoDB 3.6) with rails (5) and I have a database with customer collections and bi

psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: FATAL: database "myname" does not exist

I a rails app running on my local environment using postgresql. This morning I spun up a new one and after install the pg gem, etc. I am running into the follow