I'm new to ruby on rails. I installed ruby, sqlite3, node and yarn, run gem install rails and gem install sqlite3. when I run rails new <app_name>, I got
I'm having a trouble when I try to use Simple Form gem for upload video. I'm using ActiveStorage and local storage for this. My form looks like this: = simple_
I have a very large table Metrics with a primary integer key named id. The primary key is 32 bit integer and is about to overflow. My attempted solution to this
To get a single random record from the db, I'm currently doing: User.all.sample But when there are 100000+ users, it takes a few seconds to load them all, jus
I am using rails 5 and the form_with helper. My code works when using Form_for, but not Form_with. Is the :as parameter not valid with Form_with? View <%= f
The Rails 5 command rails g migration create_foo_bar_join_table generates the following migration: class CreateFooBarJoinTable < ActiveRecord::Migration[5.0]
I want a nested transaction to fail the parent transaction. Lets say I have the following model class Task < ApplicationRecord def change_status(status,
I have a React client app that needs to talk to a Rails API. I want to use the rails-ujs method Rails.ajax. For example: Rails.ajax({ type: "POST", url: "
I'm trying to export my database to CSV file and download it but it doesn't download. I have a form with 2 different actions, Export to CSV and Export to JSON I
I have a Rails 5 app and I am trying to import my Environment Variables in a yaml file, which I can then import in the environment.rb. My config/aws.yml looks a
I try to change the default column value from false to true. But when I run rake db:migrate VERSION=904984092840298 I got the following ERROR. StandardError: A
I am trying to cache the results of API calls. My application makes multiple calls with the same result and I would like it to use the cache to save time. When
I am storing my secret key in environment and /config/environments/production.rb has config.require_master_key = true uncommented config.require_master_key = t
There's a function called index_exists? in ActionRecord, but no foreign_key_exists? on Rails 4.2.7. So when I call remove_foreign_key :parties, :franchise_gr
I'm working with Rails 5 an I just have created a Media model using scaffold tool. rails g scaffold media name:string And I got different names and routes and