Ruby on Rails Community Forum

How to model these relations in Rails

6
Rails
For a couple of days now i am going back and forth how to models this. I currently have the following model structure and relations (simplified) ``` class Fleet < ApplicationRecord # proper...
Drazen replied
Solved

How to attach a remote S3 file to an outgoing email? [SOLVED]

3
Rails
I'm using a regular mailer to send text emails and now I want to attach a file stored on S3 to the email. I have the URL of the file and was naively hoping something like this would work: ``` def ...
Daniel Weaver replied
Solved

Rails 6.0 + Heroku + Active Storage + VIPS

7
Servers
VIPS is a 3x faster and 10x less memory hungry image processor that is now available for Active Storage in Rails 6.0. Unfortunately By default Heroku doesn't support VIPS. Do you know of a working ...
Nicolas Brousse replied

accepts_nested_attributes_for with a first_or_initialize

0
General
How do you handle a Model that `accepts_nested_attributes_for` for another Model, where you only want `first_or_initialize` that child model? At the same time, be able delete the relationship betw...
george norris posted

How do I integrate VueRouter into an existing Rails app?

0
General
Hi, I'm trying to get VueRouter working with an exisiting Rails app and I'd like to delegate the routing to VueRouter when it comes to the VueJS part of the app. Basically I'd like VueJS to ta...
Qamir Hussain posted

How to protect API againest malicious attack?

5
Rails
Hello 👋 I'm working on an API that is reciving requests from websites (Shopify stores), the request looks like: ``` shopCentralAPI.apiToken = "123" shopCentralAPI.metafieldCreateUpdate(shopCentral...
Karim Tarek replied

Bundler And PG Error On Deployment

10
Rails
Hi, I followed every step of the deployment but when I get to 'cap production deploy', some errors appear : ``` 01 /home/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-1.17.3/lib/bu...
Damian Nelwep replied

How do I temporarily redirect stderr in Ruby on Rails?

2
Rails
Hi, gays. I would like to ask for advice. I asked this question on [StackOverflow](https://stackoverflow.com/questions/56828359/how-do-i-temporarily-redirect-stderr-in-ruby-on-rails) , but I did no...
Alexey replied

Unable to create the Rails app in WSL

1
Rails
Hey, I am getting these errors while creating the app in WSL. Please help to fix it. Would be very much appreciated. **Error Images** https://uploads.disquscdn.com/images/b39eba240df8adcde8fc0b3ae...
Chris Oliver replied

Can't modify frozen String

0
General
Hi guys, I'm tring to execute rspec to run my tests and I'm getting a error Failure/Error: visit 'http://google.com.br' FrozenError: can't modify frozen String Any ideas h...
rodrigomerlo posted

GEM dependencies for implementing Google Pay and Apple Pay in Ruby

2
Gems / Libraries
We have an ecommerce website using Stripe as the payment provider and want to implement Google Pay and Apple Pay. For background, we are running a lot of out of date GEMS and Ruby is currently at v...
Xst996 replied

Namespace rails belongs_to

1
Rails
I have the following configuration module Account class Permission
Lidia Wisniewska replied

How to test attachments in ActionMailbox?

4
Rails
I'm trying to test attachments using receive_inbound_email_from_mail, but when inspecting mail.attachments I get an empty array. Is there another way around this? receive_inbound_email_from_mail( ...
Taha Husain replied
Solved

How do I integrate Uppy.io or Dropzone.js into Rails with ActiveStorage?

12
Gems / Libraries
[Uppy](https://uppy.io/) and [Dropzone](https://www.dropzonejs.com/) and popular js libraries that provide rich user experience for file uploads. ActiveStorage supports the integration of such libr...
Ivan Raszl replied
Solved

How do I remove Devise::Trackable from my app?

1
Gems / Libraries
I'd like to remove the Trackable module of Devise. Is it as simple as removing `:trackable` from the `devise` line in `User.rb` and then creating a migration to remove the columns created for the ...
Chris Oliver replied
Solved

How to build something like a Youtube advertisement system

2
Rails
Hi Chris, I am pretty sure they have a complex system implmented but at the basics of it, how could you go about implementing an autoplay advertise video before the actual video itself starts to p...
Darren Booker replied

Need a hand with associations

6
Rails
I have a users model, and an accounts model. Basically I would like to have... - An account has one owner - An account can have many users - Users can only be a member of one account. Does the fol...
Ivan Raszl replied

How do i create and custom module with view

1
Rails
Planning to create a generic module for filters in my app. Is there a help where i can see how to create the modules and how the file structure would be for that?
Ivan Raszl replied

Video idea: Google insights

0
Rails
Hi Chris, Would be nice to see a video about optimizations for rails for better score in google's page speed test. https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fgorail...
Pedro Carmona posted

How to mark a post as read, so that it won't show up again for a user?

6
Rails
I was looking at the unread gem but it seems a bit complicated and many seem to run into difficulty with it. Instead, I was thinking of adding an 'already_read' column (boolean) to the post mode...
Monroe Mann replied

Learning Ruby on Rails? Join our newsletter.

We won't send you spam. Unsubscribe at any time.