ruby-on-rails-5 Questions

1

Solved

I'm having trouble understanding what initialize_on_precompile was used for. What exactly did it mean for it to be false (especially as it relates to Heroku)? What did it mean for it to be true? A...
Stevestevedore asked 9/1, 2017 at 1:17

1

Solved

I've read about this for some time now on various SO threads, guides, etc... but all the answers are conflicting and contradictory. It seems there's many similar methods, and a lot of the answers ...
Epanaphora asked 31/12, 2016 at 18:22

1

Solved

I'm learning how to use Module.prepend instead of alias_method_chain in my Ruby code, and I've noticed that some people use send to call it (example): ActionView::TemplateRenderer.send(:prepend, ...
Carbonation asked 3/1, 2017 at 8:47

2

Solved

I am following the RailsTutorial and have been creating a Users model with appropriate attrs and validations. I've run into this error and cannot see where the problem is. The project is configured...
Interloper asked 29/12, 2016 at 21:53

2

Solved

We know that Rails 5 added ApplicationRecord as an abstract class which was inherited by our models (ActiveRecord). But basically, I think every technical requirement we do with ApplicationRecord,...
Jobholder asked 21/5, 2016 at 6:10

1

Solved

I'm trying to add a json column in MySQL db by running: class AddStatisticsToPlayerStatistic < ActiveRecord::Migration[5.0] def change add_column :player_statistics, :statistics, :json end e...
Distorted asked 24/12, 2016 at 12:14

2

Solved

Not able to start rails5 with jruby, getting the following error. gavinyap@gavin-ubuntu  ~/Development/rails5app  rails s DEPRECATION WARNING: alias_method_chain is deprecated. Please, use Modul...
Polysyllable asked 25/7, 2016 at 7:59

3

In my ability.rb, I have the following rule: elsif user.has_role? :demo can :read, Profile, demo_featured: true, demo_linked: true, message: "To access this profile, please subscribe here." But...
Flammable asked 12/12, 2016 at 7:42

1

Solved

I am using Rails 5 and I am trying to improve error handling for invalid JSON requests to my API. I tried handling invalid format JSON by parsing in the controller with a rescue but realised that ...
Consequence asked 16/12, 2016 at 17:41

2

I've deployed a new version of a Rails 5 app on Heroku, running on cedar-14 stack. It didn't precompile while deploying, so I did heroku run rake assets:precompile manually. Still, I can see it inc...
Ligniform asked 21/9, 2016 at 13:11

8

Solved

I would like to Trigger some JS only the first time a user logs in, and only the first time a specific page is loaded. I believe I can deal with the first time they log in, by simply checking user...
Adolescence asked 4/12, 2016 at 23:48

1

Solved

I have a vagrant box(ubuntu xenial) with my rails (5.0.0.1) development server and every time I change a model or a controller I need to restart the server. I've tested with puma and webrick and t...
Ethelynethene asked 9/12, 2016 at 18:53

0

So I have a simple link: %td= link_to("#{fa("institution")} #{entity.short_name}".html_safe, entity_path(entity), class: "button", data: {disable_with: "<i class=\"fa fa-spin fa-circle-o-notch\...
Ms asked 8/12, 2016 at 16:3

1

I upgraded a production app from rails 4 to rails 5 a few days ago, and I have seen a big increase in CPU utilization on my RDS postgresql instance. There does not seem to be any associated increas...
Hirsute asked 12/11, 2016 at 2:15

1

Solved

So have a rails 5 project and would like to load a directory like this /app /services /user foo.rb as the constant ::Services::User::Foo Does anyone have experience in getting rails autoload...
Cralg asked 1/12, 2016 at 21:50

1

Solved

I'm having a problem when sending a controller params that look like this: { id: "1", stuff: {"A" => [], "B" => [], "C" => [], "D" => []} } The method only sees { id: "1" } and the e...
Aminta asked 29/11, 2016 at 16:28

2

Solved

I know there are already some questions and also this is a open issue regarding AMS not handling namespaces too efficiently (which is used by this versioning approach) but I wanted to be sure I am ...

1

Solved

I am using Rails 5 and ActiveJob to process background tasks. I am trying to pass a object serialized with as_json to my job but I am receiving the following errors: ActiveJob::SerializationError ...
Emf asked 30/11, 2016 at 17:35

1

Solved

I have two ActiveRecord models having a HABTM relationship with eachother. When I add an AccessUnit through a form that allows zones to be added by checking checkboxes I get an exception that the A...

1

Solved

I have a Profile model that has the following: has_many :transcripts, dependent: :destroy accepts_nested_attributes_for :transcripts, allow_destroy: true On my Transcript model, I have the fol...
Gaillard asked 17/11, 2016 at 7:27

2

Solved

I have a Profile#Index view, where I render a partial like so: <% cache @profiles do %> <div class="wrapper wrapper-content"> <% @profiles.to_a.in_groups_of(3, false).each do |pro...
Hippodrome asked 7/11, 2016 at 4:42

2

Solved

Problem Lets say I have two Models with a has_many-belongs_to relation. The has_many has a scope defined and an integer attribute named grade. class Parent < ApplicationRecord has_many :child...
Alacrity asked 14/11, 2016 at 16:51

2

Solved

I have a table of Albums that has a date column named release_date. I want to get a list of all the month + year combinations present along with the number of albums released in that month/year. ...

2

Solved

In rails 5 created with --api I have an error NoMethodError (undefined method `respond_to' for #<Api::MyController:0x005645c81f0798> Did you mean? respond_to?): However, in the documentat...
Fulfillment asked 14/3, 2016 at 9:23

3

I am getting this error when i try to use the code below, link_to params.merge(:sort => column, :direction => direction, :page => nil) do "#{title} #{content_tag(:i, "", class: "fa fa-ch...
Cantara asked 11/7, 2016 at 13:23

© 2022 - 2024 — McMap. All rights reserved.