Generate ActiveStorage image variants after upload

1
Rails
I have a model that has a photo attached and this photo has few variants. I would like to display many of these photos as a gallery and i am using one of the variants as a thumbnail and another one...
Alex F replied

Rails 7 with esbuild application production deploy failed

5
Rails
Hello there, I'm using Capistrano for production deployment, getting below error when I try to deploy my rails 7 application to DigitalOcean server. ``` 00:43 deploy:assets:precompile 01 $H...
Viktor Smári replied

How to solve a status 308 with Action Mailbox?

1
Rails
Hi ! I am trying to send email from my Gmail accounts to my Rails application using Action Mailbox. To configure it, I've followed this tutorial https://gorails.com/episodes/action-mailbox-rails-...
Helena replied
Solved

Devise and Hotwire

1
Rails
Hi guys, I'm getting an error with devise and hotwired/turbo. This is only when I use the current_user helper in any of the partials that receives any broadcast, the error is the following: ``` De...
Jeppe replied

Share resources among controllers?

3
Rails
Hi, I’m not even sure I’m using the correct terminology here (sharing resources among controllers) but here goes. Imagine I have a page called students with the usual CRUD functionality and anothe...
Solved

Rails Association Question

1
Rails
Hello I have an app where I have a list of Cars. I have a form above that can filter them based on different attributes. I wish to add filtering based on their model and sub-models. Each car alre...
Chim Kan replied

Hotwire Not Working Inside of Namespace

0
Rails
This seems like an easy fix, but I am not sure why its not working. I have an admin dashboard using Hotwire, but I can't seem to create records for my gym model (There are no errors, and it will wo...
Brian Gilbank posted

How do I use Rails.ajax() method

0
Rails
My web console is giving an error message that "Rails.ajax is not a function". I'm following the tutorial on Drag and Drop Sortable lists at https://gorails.com/episodes/rails-drag-and-drop-sortabl...
Owen Millward posted

How to implement signup page for devise for two types of users?

0
Rails
Hi there, I would like to implement STI for devise which will have two types of users. The first type of user is allowed to signup and I have called this as "PublicUser" and the second type of user...
Ponciano Vieira posted

How do I make Paper trail log onto a different database engine rather that the main database ?

0
Rails
I have a project that has an established database connection and I am trying to separate the versioning of paper_trail onto another database.
Abdelfattah Hezema posted

Finding records using Delegated Types

0
Rails
Hi, I have a Delegated Types association set up like below and I need to find a particular Collection but the flickr_id is stored in the GalleryItem table. It's failing to return anything. How...
Neil Tonge posted

Active Storage Rails 6 API unable to insert to active_storage_attachments table

1
Rails
I am creating API endpoint for active storage with reactjs. My upload controller is as follows: The code belows execute: insert blob object in active_storage_blob - ok Uploaded file to the design...
garxu21 replied

How do you create and save an Active Record instance that has a reference to itself?

0
Rails
`Files` is an Active Record model that has a reference to its parent of the same type: ```ruby class Files < ActiveRecord::Base belongs_to :parent, class_name: "Files" end ``` I want to creat...
Perry Smith posted

custom sql in migration breaks in test env?

0
Rails
Hi. I added a migration with SQL to create a full text search column. Worked fine in development, but when I pushed, our git hooks tried to run the tests, and I got a pending migrations error. I ...
Luke Gilliam posted

How do I #create with a double delegated_type and has_many :through

5
Rails
I have this marvelous complicated DB design that goes along these lines: events ( like calls, tasks, and meetings ) can have a number of assignees (Participants, and Assets) - like a Team Meeting c...
Walther Diechmann replied
Solved

rails user profile privacy

0
Rails
I have a devise User model and Profile model, the relation is User has one profile. I want the user to be able to chose what information about themselves to share with their friends only or with th...
Han posted

BCrypt: Can't validate passwords

1
Rails
I can't seem to get BCrypt to validate my passwords. I'm trying to get back into rails with 7. Can't seem to get passed password validation for my Admin: As I understand it. It's a very straight ...
sweedledee replied
Solved

Ordering with included models

1
Rails
Is there a way to order results using a column from a model and a column from a related model via includes? Here is a scenario: A product that has many parts, each of which has a numerical value a...
HP replied
Solved

How to delete parent object when last associated child is deleted?

1
Rails
I have a Family model that `has_many` Kids. I'm using `dependent: :destroy` on the family so when it is destroyed the associated kids are destroyed too. All good. Now I need to destroy the family ...
Suleman Uzair replied

Devise and OmniAuth - correct approach?

0
Rails
Hello, I decided to start building a social media scheduling tool as I figured it would be decent portfolio project for a junior dev. I'm a little confused as to how to integrate Users' social me...
Christian posted

Want to stay up-to-date with Ruby on Rails?

Join 89,968+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.