One form, two separate controllers, created at once.

1
Rails
I'm trying to create a sign_up form where the user will choose his email + password AND and Article at the same time as creating a user account. So assentially, one form will create a new User ...
naveen kumar replied
Solved

Opt-in to receiving thread notifications

8
Site Feedback
Hey Chris, It would be great if users had the ability to opt-in to receiving new thread post notifications. Sometimes I like to just throw my two cents in, but don't really intend on following th...
Jacob Montgomery replied
Solved

Optimizing Queries in Service Objects

9
Ruby
I'm currently building an app and using namespaced service objects containing a single call method in each class. Below is an actual method (I'm aware the ABC size is too large, I'm wanting to get...
Jacob Montgomery replied
Solved

Updating sort_index attr on a collection of models

9
Rails
Hey there! I've got a collection of models (Product) and each product has an attribute called `sort_index` that allows the store owner to set a specific order for their products. The UI allows the...
Sean Washington replied
Solved

How to add or call a particular action in all the controllers ?

4
Rails
I want to store the user activity by using after_action in the all the controller for a specific action of those controller
nynhex replied
Solved

Deck Builder App. How do I query only decks you can make with the cards in your inventory?

7
Rails
I'm making a deck building site similar to hearthpwn.com. It would be nice if users could filter decks based off the cards they have in their inventory. In other words, I'm trying to make a query ...
Matias Fernandez replied
Solved

Everyone's Been Bitten Before - Whitespaces/Unwanted Characters in User Input

2
Rails
Hey all! I've got an interesting question, and I'm sure you're all handling it in different ways. I know there are plenty of ways to tackle this problem, so I was interested in what everyone's doi...
Nick J replied
Solved

What text editor are you using for GoRails Forum?

4
General
Hey Chris & Community! :) What text editor are you using for the GoRails Forum post? Im following the episode [Markdown and Emoji with the html-pipeline gem](https://gorails.com/episodes/mar...
Lauro replied
Solved

[HATCH] Error deploying app

3
Rails
I'm getting this error when trying to deploy my project with hatch. I made sure I have the RSA file. Deployment Error ``` Fetching origin Warning: Identity file /home/deploy/.ssh/thinkrtc_rsa not...
Chris Oliver replied
Solved

Autoloading models not working

2
Rails
Hi, I have this model structure ``` /models /survey /questions question.rb survey.rb ``` I have used this autoloading in my application.rb so I don't have to deal with modules everyt...
Chris Oliver replied
Solved

why drop down menu (Account Setting)is not showing in sidebar?

1
Rails
``` my html <%= csrf_meta_tags %> <%= stylesheet_link_tag "bootstrap.min", media: :all %> <%= stylesheet_link_tag "dataTables.bootstrap.min",...
naveen kumar replied
Solved

Is it necessary to use authentication with an API if there aren't really any 'users'?

3
General
I'm writing a React Native app that is purely informational (medical information), with a Rails API for the back-end. The first main question I have is whether its necessary (or a good idea) to us...
Greg Blass replied
Solved

why destroy action is called two times.

6
Rails
my destroy action def destroy @owner = User.find(params[:id]) @owner.destroy respond_to do |format| format.html { redirect_to root_path } format.js {} end my index page delete link ...
naveen kumar replied
Solved

Get Paperclip file before save

2
Rails
Is it possible to read the file, in my case image file, inside Paperclip::Attachment before the file is saved? I need to send the image to an api first and then from the response it's given if it...
Agung Setiawan replied
Solved

Is it Ok to use "Error" as a model name in Rails project?

1
Rails
I have a simple question about class naming: is it Ok to use `Error` as a model name in a Rails project? This model will be used to persist Ruby exception objects for errors monitoring. Using `Exc...
shakycode replied
Solved

Creating nested attribute with two parent attribute.

1
Rails
Hi, Been going round in circles for a day or so but still can't seem to find a solution for this. I have project management chat app that on sign up, you create the project and the first chat mess...
Ariff Munshi replied
Solved

Multi tenant best strategy

5
Gems / Libraries
Hi, I'm creating a multi tenant application using the apartment gem based on the video about multitenant here in gorails. The model I choose was the Account instead of Users so I can have several...
Giancarlo Corzo replied
Solved

Caching static pages without CSRF token

4
Rails
Hi, I'm looking to use `expires_in` method in my actions who returns static content. For this pages I would like to return a cache control header where `public` is `true`. Like this it allow an p...
Nicolas Brousse replied
Solved

After adding the activeadmin gem, my previous style changed, How can avoid this?

2
Gems / Libraries
After adding the activeadmin gem, my previous style changed , How can avoid this? Previous style is : ![previous style](http://calmops.com:83/down/previous-style.png) After adding the activea...
Larry Qu replied
Solved

How to setup the model associations for a simple e-marketplace?

3
Rails
Hey GoRails devs, I am in the middle of setting up a marketplace (with stripe) and could use some help in conceptually thinking about the model associations. In the marketplace: a user can sell or...
Chris Oliver replied
Solved

Learning Ruby on Rails? Join our newsletter.

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