Ruby on Rails Community Forum

On Go Rails do you use any background workers for Stripe processing?

0
General
I'm trying to figure out if I should move some of the stripe payment processing and invoice lookups etc.. to background jobs. Any suggestions for a simple membership type site? Here are a couple ...
Lance Williams posted

How do i add a ":unique => true" to an already existing reference?

2
Rails
I have my DB already set up, and it references another table. I need to add in `:unique => true` so i don't get duplicates. I cant however drop the table and start over as there are items in the...
Félix Landry-Audet replied
Solved

Multiple select for CSV Export

3
Rails
Hi there, My users can create a report record which is basically a scaffolded model "**Report**" with controller and views. The users can use this model to create records that a CSV method is usin...
Sascha M. replied
Solved

How do I configure paperclip with capistrano?

7
Servers
Hi, I deployed using the "Deploy Ruby on Rails" guide. However I paperclip attachments no longer work in production. Got the below error: Failed to load resource: the server responded with a sta...
Chris Oliver replied
Solved

Facebook Profile Image & Data using Devise in Rails

1
Gems / Libraries
I'm just starting to learn Rails so please forgive the dumb question. In my web app, I was able to set up devise successfully and then link it Facebook using Omni-auth gem. However, two things occu...
Chris Oliver replied
Solved

[Performance] - Can I Still Refactor This Code?

4
Rails
I'm building an API based Rails app and I've one endpoint to list down all active users account numbers and gold balance inside that account. The requirement is: 1. Take all active users (kyc_pas...
Zulhilmi Zainudin replied

store_accessor with jsonb nesting

3
Rails
So Im building a user permits column with jsonb. jsonb column ```permits:{ bar_permit: { key1: [], key2: "Bar", key3: false, key4: false, ...
Francisco Quinones replied
Solved

How do I create hierarchical data with a model?

3
General
I have found and played with awesome_nested_set which is _awesome_ for real. I was wondering if this is the recommended gem for managing tree data in Rails or if there are any others that would do ...
Chris Oliver replied
Solved

Is there a better way to simplify this?

9
Rails
Hi again, I want to know if there is a better way to get a list of categories which only have products. I have tried to do `@categories = Category.where(category_type: 'product').order(name: :as...
Chris Oliver replied
Solved

Any one help in pointing to a resource or webcast which explains how to interact with Google Drive API

3
Gems / Libraries
I am very new to rails and trying to build an app which can interact with Google DRIVE Api V3. I have scaffolded a Rails 5 App and used Devise Gem along with Google OmniAuth2 to authenticate and re...
Chris Oliver replied

How do I avoid having duplicate rows in a has_many :through table?

3
General
I have a Center model and a Department model. The linked :through the Local model. However, I want to avoid inserting the same match twice in the Local table. Do I use a validate statement or ther...
Félix Landry-Audet replied
Solved

Routing question: Pass a 2nd parameter in the URL?

5
Rails
Hi again :) I would like to know how to get my routes how i want them haha as we all do :) Basically i want to get the edit variant URL to be like `/products/:product_id/variants/:variant_id` ins...
Chris Oliver replied
Solved

How would I use cookies in a check_box_tag to maintain state between page requests?

2
General
I've created a multi filter widget using a search_field_tag, and multiple check_box_tags and I can't seem to figure out how to maintain the checked checkboxes state throughout the session. So for ...
Lance Williams replied
Solved

Was wondering id there is a way i can simply this ...

6
Rails
I was wondering if there is any way I can simplify this code, Ideally, I don't want to be looking up brands that are associated with the user, i want to do it on hit. ``` #Gets the ID associated t...
Alan Reid replied
Solved

Pull data from another table in a lookup

53
Rails
Hi all, I am looking up a list of articles, depending on the brand ID's - `@articles = Article.where(brand_id: brand_ids)` what i would like to know is there a way to retrieve the brand name in thi...
Jacob Montgomery replied
Solved

[HELP] How configure "pundit" to display items belonging to a parent bond

1
Gems / Libraries
I lost hours to solve it, but I know, I am a newbie =X. My use case is, if the user have role `:agency`, he can see clients. But I have to use the link between the client's agency to verify this. ...
Bruno Wego replied

Saved messages as HTML

3
General
Hi Chris, I'm wondering, on your episode https://gorails.com/episodes/message-templates, would it be possible to have one of the saved messages as HTML? I've tried entering ```testthis is a te...
Chris Oliver replied
Solved

Added last_read_at to chatroom_users_controller: No method error

11
General
Added the following to my chatroom_users_controller but keep running into a NoMethod Error. ``` def create @chatroom_user = @chatroom.chatroom_users.where(user_id: current_user.id).first_or_cre...
Rob Sturcke replied

Avoid devise automatic sign-in after email confirmation

1
General
After email confirmation, devise automatic sign-in users, how configure devise to avoid that? ```rb # devise.rb Devise.setup do |config| config.mailer_sender = 'noreply@secret.com' end ``` ```r...
Bruno Wego replied

How do I integrate Doorkeeper gem with a Multitenant SaaS Application?

0
General
So I have a Multitenant SaaS Application where users signup, pay, create an account and start using the service. Now I have received a requirement where this service needs to have a andriod client ...
Aniket Rao posted

Learning Ruby on Rails? Join our newsletter.

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