Is there a way to validate image uploads to validate dimensions?

2
Rails
Hi, I want to validate my image upload field by making a user upload only a square image (i.e 200px x 200px). I'm basically wanting square image dimentions so it will resize and nicely and not loo...
Umesh P Kafle replied
Solved

Shrine default_url with webpacker

1
Rails
I am using Rails 6.1.1 with webpacker and Shrine. The issue I am coming across is using the default URL plugin with webpacker based assets. When I use it in development it seems to load just fine b...
Dieter Lunn replied
Solved

"rails for beginners part 21"

4
Rails
i cant make work user.signed_id, it raises a no_method_error: irb(main):010:0> user.signed_id Traceback (most recent call last): 2: from (irb):9 1: from (irb):10:in `rescue in i...
gabriele garretto replied
Solved

Error Installing Rails 6.11

0
Rails
I need to install `gem install rails -v 6.1.1` but I receive the error `OpenSSl is not available. Install OpenSSL and rebuild Ruby (preferred) or use non-HTTPS sources` and I've updated OpenSSL to ...
Nic Pismiris posted

Save Each Collection Check Box on A Form as Its Own Object

0
Rails
Hello, I'm fairly new to Rails and I'm working on a pretty large, fairly complicated project for a friend as a way to challenge myself. (Hey, go big or go home right?). A little background: The ...
Kevin Hemphill posted

"rails for beginners part 14"

0
Rails
I don't understand how chris browser gives back all the result without the option local:true in the code of the form, in the new action? My end wouldn't show me even the error page in the browser,...
gabriele garretto posted

Internal Server Error with Rails API only app on Heroku

0
Rails
I'm deploying a Rails API only app with MongoDB Atlas on Heroku. I'm using Postman to test the application. When I do a GET request the response is null, but when I do a POST I get a Internal Serve...
MiquelVald posted

Webpack trying to serve incorrect files

1
Rails
I am using new relic with my app, and it seems there are often 404s that show up. The file it is trying to load is an older `packs/js/application-blah.js`, sometimes one revision old, sometimes th...
Willard replied

How can I add multiple dynmic nested fields in the same form?

0
Rails
I have a registration form that allows tournament directors to select which fields they will request when participants register for a tournament. I followed a video to add dynamic nested form fie...
Scott Moore posted

How do I track the clicks to an external url?

1
Rails
I have a link_to do block that links to an external URL and I would like to keep track of how many times the link was clicked. What would be the best way to do this? Thanks 😊
Chris Oliver replied

How do I use paddle_update_url on pay-rails gem?

2
Rails
Hi, I'm trying to integrate pay-rails (paddle) gem into my existing codebase. But having difficulties with data stored in the data column. Like `cancel_url`, `update_url` or `receipt_url`. ```ru...
Chris Oliver replied

What is the best way to have User in some group and select those groups on Event

0
Rails
Hi, I have two models User and Event. User should belong to one group and User could attend Event based on selected group. Event could be open for one or many groups. My first solution was to crea...
Jaroslav Horák posted

Active Storage - Bulk importing files stored locally

3
Rails
Hi Chris, I am adding active storage file uploading as a new feature to an existing Rails application. I have at least a couple of thousand PDF files with a standard naming format that looks like t...
Willard replied

Data are different between the one from association and the one from the actual table

0
Rails
I created 2 tables, Baby and BabyMonth. The BabyMonth has association with Month as well. There are associations between them that Baby has_many BabyMonths. After I soft_delete all baby_months by ...
Calla Jiyoung Lee posted

Running multiple Rails versions

9
Rails
Hi guys (and ladies if any), I have installed Rails with rbenv (recommended), but now because of significant changes between 5.0.1 and 5.1 versions, I want to start a new project with 5.1 (because...
Monroe Mann replied
Solved

Whats the best way to allow embedded content from another site

2
Rails
I'm building a blogging application at the moment and I am wondering what the best way to allow users to embed youtube/spotify/soundcloud content into the blog posts. From what I understand simply ...
Daniel replied
Solved

Multiple user types App design

3
Rails
Hello, Thanks for your time :) My app have 3 type of humans. 1. Admins 2. Users (regular ones) | only read. 3. BusinessUsers (creating self records) I'm using devise gem for users. I'm interesti...
Daniel replied
Solved

How do I use phonelib gem for a nested resource?

0
Rails
I am setting up telephone validation for a Lead model. Leads have a field called :phone. I'm using phonelib to validate the contents of that field. My New Lead form is nested within a second model,...
Seth posted

Best way to approach these 2?

1
Rails
Morning everyone, I have two issues. First off, I have a meal planning app. I want to display # of recipes #&# mealplans a particular user has (obviously user would have to be logged in). ...
John replied

F.submit not creating object

1
Rails
Hi, I have a Store object with some nested attributes which I display in a wizard. But when I want to press the submit button, nothing happens and doesn't create a store. I use <%= f.submit cla...
William Kennedy replied

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

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

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