Improve on these ActiveRecord requests?

4
Rails
I am trying to get the top 5 products, based on the impressions that product has recieved. Now the code below is working ok, but its not in the right order, and I cant work out a better way to get...
Alan Reid replied

Why are these partials rendering differently?

8
General
I’m doing a thing where I’m rendering table rows: ``` <%= render partial: "choices_table_row", collection: @images, as: :image %> ``` Then, inside that partial: ``` <%= image.name %&...
Chris Zempel replied

GoLang vs C++ These two are the leading programming languages

0
General

what options are there to license my rails application to endusers, like concurrent users or counted users. How can we manage that with rails, or so I need to write something from scratch

0
General
SO I have created an rails application, that I want to distribute for a fee. It will be hosted on AWS elastic servers with autoscale. I need to somehow have the ability to generate liceses for ...
jl@lejoly.com posted

Was wondering if there is a tutorial on how to setup background job server in Ubuntu with Rails

1
Rails
Is this available somewhere?
Chris Oliver replied
Solved

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 generate these episodes applications Scaffold used by Chris?

3
Rails
I would like to know if there is any guide that shows how to generate this initial Scaffold of the application (with device, gravatar, bootstrap, all configured to start a new project quickly), lik...
Alisson Patrick replied
Solved

Recommended Gems - share them here :)

0
Gems / Libraries
Most of my recommendations are performance oritented but I'll be happy to hear about Gems that can help in other domains. 1. PGHero https://github.com/ankane/pghero , great to keep track of your d...
Ohad Dahan posted

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

How do I access these submitted Stripe card parameters in my controller action?

0
Rails
I'm having a confusing issue with a checkout process I've created for an online shop (Rails 7.2.0, MYSQL database). I'm using the Stripe Gem to process payments. It is working fine but I need to us...
Tee posted

I am wondering if there is a way to access the current_tenant ID within a sidekiq job?

1
Rails
I can see that everything is scoped to the tenant via `ActsAsTenant.with_tenant` https://github.com/ErwinM/acts_as_tenant/blob/master/lib/acts_as_tenant/sidekiq.rb but wondering if I wanted to acc...
Michael Smith replied

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

Refactoring controllers to keep them RESTful

3
Rails
Hi gang I have a feature where a user can query the Google Books API with an ISBN number and get the book as a response. I have this all working nicely, but I'd like to refactor my `Books` control...
Nino Rosella replied
Solved

How do i create these associations so they are sortable?

0
General
I need some help figuring out how I should associate my models. I have three models: ``` class Series < ApplicationRecord has_many :modules has_many :episodes end ``` ``` class Module &lt...
Twig posted

How do I combine these two buttons

0
Rails
im trying to combine the paypal button and the f.submit button but have no idea How to get there Is there any better suggestion ` // Render the PayPal button int...
dinesh124 posted

How do I improve these relationships (Rails Association question) ?

1
Databases
Im trying to make a project to practice more kinds of associations would you kindly help me understand this? The basic idea is to have a betting game where one user generates a new bet that can on...
Nicholas Bayley replied
Solved

Can Anyone explain me these ruby codes?

1
Rails
Recently I am started learning ruby on rails. I am doing a project on ruby on rails. In my project there are some code in application.controller.rb . But I am not understanding the meaning of the c...
Sean M replied

How would you improve these db's and associations

2
Databases
Database Structure Hello people. I have my first proper paid Rails project to start soon, so I’ve been thinking about the database and the associations. The two links below are the databases and...
Shaun Fahey replied

How would you set up these plans in Stripe?

2
Gems / Libraries
We bill our customers on monthly subscriptions, based on their resource usage in the app. They are private music schools and we charge by the number of students they have.The ranges are as follows:...

Devise redirects to /users when there is an error editing profile

6
Gems / Libraries
I would like to know how i can change the redirect path so that when my editing a user fails it redirects back to `users/edit` and not to `/users`. To replicate this i am entering a duplicate emai...
Alan Reid replied
Solved

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

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

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