ruby-on-rails Questions

14

Solved

I am having a problem installing the mysql2 gem. This comes up when I do gem install mysql2: Marks-MacBook-Pro:~ Mark$ gem install mysql2 Building native extensions. This could take a while... ER...
Continue asked 23/3, 2011 at 18:16

4

Solved

Am trying to access the token from ExactOnlineAPI but the documentation recommends to only use x-www-form-urlencoded. Does Ruby on Rails has this kind of encoding, if so how can i use it. What is ...
Gaeta asked 10/12, 2015 at 14:0

15

Solved

I'm using Rails migrations to manage a database schema, and I'm creating a simple table where I'd like to use a non-integer value as the primary key (in particular, a string). To abstract away from...
Painter asked 29/7, 2009 at 14:15

5

I am new in Ruby on Rails and i am using Ruby version 2.1.0 and Rails 4.0.2 My Query is:- I want to call Model in initializers. my Model file is setting.rb and Model name Setting. its location i...
Ricarda asked 27/3, 2014 at 6:38

6

Solved

I have users entering in dates in a Ruby on Rails website. I parse the dates into a DateTime object with something like: date = DateTime.new(params[:year].to_i, params[:month].to_i, params[:day].t...

2

Solved

In the sidekiq documentation, there is this quote about preferring to use /app/lib instead of /lib in Rails projects related to autoloading errors: A lib/ directory will only cause pain. Move the ...
Horary asked 11/9, 2018 at 20:53

9

Solved

Well, everything's in the title but I'll explain a little more :-) My rails app contain many forms (Ajaxified or not). To prevent users to submit twice or more some forms, I use Javascript. Ther...

2

Solved

I am using Ruby on Rails 3 and I would like to disable and toogle the CSS class of a form.submit when the form is AJAX submitted and until the AJAX HTTP request is completed (I am using the default...
Phaeton asked 5/3, 2012 at 17:13

8

Solved

I want to get list of records with attached images as a links or files by api. I have a simple model: class Category < ApplicationRecord has_one_attached :image validates :name, presence: tr...

7

Solved

I'm testing my app on my mobile phone (samsung galaxy note II with chrome) and I have a problem with the numeric input fields. In my app these fields can accept negative numbers, and on the brows...
Skiagraph asked 10/2, 2014 at 12:48

9

I need to add a link to download the file from assets/docs/Физика.pdf I do not know how to do that. I am trying to do so here: in view - <%= link_to "download", '/Физика.pdf', :download => ...
Rile asked 21/8, 2016 at 23:53

3

Solved

I am having an issue when trying to destroy an active record instance. It involves the following AR class Client < ActiveRecord::Base has_many :phone_numbers, :dependent => :destroy has_m...
Tauten asked 7/4, 2009 at 22:9

4

I'm making a website for a class and I'm trying to implement a friend request function with a model called 'Users' and a join model called 'Relationships'. I have a button on the user#show page tha...
Merrymerryandrew asked 7/12, 2015 at 15:56

3

Given the following setup(which is not working currently) class Employee < ActiveRecord::Base end class Manager < Employee end ActiveAdmin.register Employee do form do |f| f.input :name ...
Loup asked 16/7, 2012 at 1:48

5

Solved

I want to make S3 bucket public to everyone but I get access denied when I do That and it Says You can't grant public access because Block public access settings are turned on for this account. T...
Manual asked 11/5, 2019 at 21:22

5

Solved

Given a model with ActiveStorage class User has_one_attached :avatar end I can check whether a single user has an avatar @user.avatar.attached? But how can I return a collection of all us...
Didst asked 20/9, 2018 at 5:23

3

Solved

I am fairly new to Ruby on Rails, and I clearly have an active record association problem, but I can't solve it on my own. Given the three model classes with their associations: # application_for...
Wil asked 23/11, 2009 at 5:9

4

Solved

I have a fairly decent grasp on the basic Rails concepts like ActiveRecord, routing, migrations, etc. One thing I'm having a hard time understanding is ActionDispatch. I can't find a plain-English ...
Ralina asked 29/5, 2013 at 19:53

3

Solved

I have this example FactoryGirl.define do @site = FactoryGirl.create(:my_site) factory :user do email { Faker::Internet.email } first_name { Faker::Name.first_name } last_name { Faker::Name.l...
Dickson asked 6/7, 2012 at 14:56

5

Solved

I'm trying to start puma, but at the last step it fails like this: 16:38:09 web.1 | /home/ramonpm/.rvm/gems/ruby-2.2.7/gems/puma-3.9.1/lib/puma/launcher.rb:130:in `initialize': No such file or dir...
Perturb asked 17/10, 2018 at 19:45

5

Solved

I don't understand why this is happening. I have the following migration: def self.up create_table :leakages do |t| t.integer :feature_id t.integer :project_id t.float :total t.date :apt_date...
Furlana asked 18/7, 2013 at 6:17

5

Solved

I'm trying to use Sidekiq to run the below job. The job performs fine when not queued (perform_now) but fails when called as (perform_later), which uses Sidekiq. AddEmployeesToRoomJob.perform_no...
Dilate asked 20/8, 2016 at 15:20

4

Solved

I have a Rails 6 app that uses Active Storage to store multiple images to a model (Activity) with has_many_attached. I don't understand how to append extra images instead of replacing the existin...
Mande asked 18/1, 2020 at 19:13

5

I have a simple query need: Find a list of users who made an order since Jan 1, 2013. In SQL, it's a very simple query. But I'm using Rails and Active Record. So I wrote: User.joins(:orders).whe...
Wallet asked 5/3, 2013 at 17:43

4

Solved

As far as I know, assign_attributes (unlike update_attributes) is not supposed to save the record or for that matter, any record. So it quite startled me when I discovered that this is not true wh...
Chelseachelsey asked 29/6, 2017 at 7:57

© 2022 - 2024 — McMap. All rights reserved.