Questions tagged [ruby-on-rails]

Ruby on Rails is an open-source web development framework optimized for programmer happiness and maintaining sustainable productivity. Many things are defined by convention, freeing you from having to re-invent things to stay productive.

19 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6
votes
0answers
351 views

Rails on AWS Elastic Beanstalk - limitations

I have been looking at AWS Elastic Beanstalk service for the deploymeny of my rails application, and I came to think it was actually a bad idea given some specific requirements of my application. But ...
4
votes
0answers
715 views

Splitting up a Rails/Ruby app onto multiple servers

We recently moved a large application to two machines, both running the same codebase. I. Machine A Web server for public facing application Receives web hook call backs from our ESP Handles a ...
4
votes
1answer
312 views

Caching data in a Rails variable instead of querying the database?

I have a list of about 15000 items in my database, every one of them has a unique ID and name. New items are added regularly but usually not more than ten a day. My frontend uses a form with ...
4
votes
1answer
1k views

Best way to build a JSON API coupled with HTML views in a Rails project

I've got a Rails eCommerce project communicating with an iOS app. The iOS app receives JSON data from the Rails back-end, but there's also HTML rendering when a user comes to the project from his ...
3
votes
0answers
258 views

Rails: get data about a model collection, with new model or method?

I have a model Product with attributes sales and views. I need to get sales/views count of all the products. Is more correct to implement this as a method and have a call like Product.all.sales or ...
2
votes
0answers
129 views

Why separate routes and controllers in MVC backend applications?

I've dabbled in a few MVC frameworks (like Rails and its ilk) and I've noticed that the file that defines restful routes often go separate from controllers which hold the actions executed through ...
1
vote
0answers
31 views

Tracking flakey tests in Ruby on Rails / Rspec - is there a way to do this?

Currently working on a Ruby-on-Rails codebase, testing is done with Rspec. We use BuildKite to run tests. We are in a situation where sometimes tests will fail, and upon a retry or two, pass. AKA, we ...
1
vote
0answers
16 views

Best RoR pattern for special instances of a subclass

I'm trying to figure out the best way to "partially" use the validates_uniqueness_of validator for a particular case of problem. Let's say I have a Book class with multiple comments, with the Comment ...
1
vote
0answers
55 views

Is it better to have a default avatar library on client or server side?

I have a webapp using ReactJS as the frontend and Rails as the backend service. I have an account manager, where a user can choose multiple avatars from a default library. This library contains ...
1
vote
0answers
39 views

Building a schedule app - best design pattern for collection on Rails API

I’m building a web app using Rails API on server side. The goal is to make a planning manager. I want my users to be able to plan ‘daily’ events, which will display at some specific weekdays, with ...
1
vote
0answers
80 views

reading parameters and files on browser, looking how to execute on server

I have a site done in Rails, which uses javascript to load files and generate forms for the user to input certain information. Those files and parameters are then to be used in a fortran code on the ...
0
votes
0answers
22 views

Sharing ActiveRecord class between two Rails app with gem

We have several Rails applications using the same ActiveRecord, Book. For simplicity let us assume we have only these two: BookWarehouseApp (that deals how new book are added, or other inventory ...
0
votes
0answers
35 views

Is it okay to include assets (css, js) outside of webpack?

i'm making an app in Rails 6, and i've included my css/js assets in public direction. Is it fine? I know that webpack makes code faster and lighter. But do i make some mistake if i just include code ...
0
votes
0answers
26 views

Ruby on Rails newbie question, regarding general design for models/controlers for feedback app/ my thinking

I am working on a little project which essentially allows me as the administrator to upload new products to the app (each product would be a video explaining product) which would have its own specific ...
0
votes
0answers
63 views

Call external API during validation (Rails)

I need to validate a value with data from an external API. The easiest way would be to add a validation rule in my model, call the external API and do my check. But it feels very dirty to call an API ...
0
votes
0answers
41 views

Good practices: using member routes or filter on search scopes?

I want to know which practice is more convenient having the following example, (my app is a Rails app but this can be applied on any framework) I am trying to create an endpoint which contains author ...
0
votes
0answers
16 views

Regional test-of-concept environment, whose database must be merged back to the main server afterwards

My client wishes to launch a specific version of the Rails platform I am developing that will be restricted to a particular group of users (some sort of test-of-concept). I will have another server ...
0
votes
0answers
721 views

Creating a new database with Active Record

Please tell me if this is mad, but basically, I've created a custom rake task, and before it does its thing, it gives the user a warning message: Warning, please back up your database before ...
-1
votes
1answer
51 views

Implement Customizing records

I have the following tables: Organization. Articles Templates Organization is the parent of both articles and templates. On the articles index page, I display (by default) all templates for the ...