Data dodania Pytanie
2017-03-07 05:03 NoMethodError: undefined method `name' for :account:Symbol »
I am trying to query the following Vehicle.where(:account.name => "").count and I get this error: NoMethodError: undefined method `name' for :...
(2) odpowiedzi
2017-03-06 22:03 How to write route for the scenario below »
I have a JSON route path that looks like this: /jobs/{jobid}/employees/{employeeid}/departments/cubes/{cubeid}/register The following route works ...
(2) odpowiedzi
2017-03-06 18:03 How to fetch all objects of a model in serializer? »
I'm using ActiveModelSerializer for a Rails API. On some controller inside index action I need to display all existing objects of class Book. def ind...
(1) odpowiedzi
2017-03-06 15:03 Pluck returning duplicated results »
I am facing the following issue. My game object has two associated players, as we can see: => game.players.count 2 However, the pluck method is ...
(1) odpowiedzi
2017-03-05 22:03 Rails have not created test directory for me? »
I have created a new application of Ruby on Rails. I use RubyMine and created the project using New Project->RailsApps Sample->rails-devise-pundit I h...
(0) odpowiedzi
2017-03-05 16:03 Installing rails 4 - different results »
I've noticed a certain little difference when installing rails on a server (Ubuntu 14 LTS). I didn't used any ruby version managers like rbenv, rvm or...
(0) odpowiedzi
2017-03-05 14:03 undefined method '_path' with references »
I'm looking for make draw lesson with a differente gallery link with each lessons for the users can uplaod there work in. I have a controller, model ...
(2) odpowiedzi
2017-03-05 02:03 Rails how get foreign_key on a mailer? »
On a order confirmation both the seller and the user receive the confirmation but after add the seller_id or buyer_id rails spits out error! i'm look...
(1) odpowiedzi
2017-03-04 18:03 Images are not updating in the browser after they are changed in the database »
A User has a photo. When they update their photo, it is successfully updating in the database however it does not update in the browser. If I open a d...
(2) odpowiedzi
2017-03-04 17:03 Where in Devise does Devise issue SQL? logout crashes »
This is (at least) a two part question. Every time I do a git commit I also do a VMWare snapshot. Using VMWare and Git I have managed to isolate whi...
(0) odpowiedzi
2017-03-04 11:03 How to restrict request based on params in ruby on rails »
I want to update my API to v5 (post /api/v5/registrations) and still want to support v1,v2,v3,v4. Under v5, I do not want process the create/update re...
(1) odpowiedzi
2017-03-03 23:03 Concatenation of values »
I am trying to concatenate the ":" sign with value that is inside a variable but when trying to concatenate it shows me the following error: bad URI(i...
(2) odpowiedzi
2017-03-03 14:03 Ruby on Rails: Validate checkboxes in build relationship »
In my RoR application, I have the models Emails, Recipients, and Contacts, whereby when creating a new email the user selects the contacts they want t...
(1) odpowiedzi
2017-03-03 10:03 Ruby on Rails: ActiveModel::ForbiddenAttributesError with strong params »
In my RoR application, I have an update_multiple method that updates multiple records with the user's inputs. However, for some reason I get the error...
(2) odpowiedzi
2017-03-03 09:03 unable to determine if controller based asset exists without .js extension rails »
I have added assets for a controller and wants to include them per request. The problem is that it does not include that assets without writing .js ...
(0) odpowiedzi
2017-03-02 15:03 ActiveAdmin - failed adding custom page page under a resource »
I'm trying to add a custom page under one of my resources (ActiveRecord) - on the ActiveAdmin site this was listed under the 'belongs_to' section Som...
(0) odpowiedzi
2017-03-02 15:03 ActionView::Template::Error (undefined method `FirstName' for nil:NilClass): »
I have a fairly simple association between my registrations and contestants models. class Contestant < ActiveRecord::Base has_many :registratio...
(1) odpowiedzi
2017-03-02 13:03 How to add uniqueness on many to many using through on column of other table »
I have two models Company, Asset and a join model CompanyAsset and the association is as follows: class Company < ActiveRecord::Base has_many :c...
(2) odpowiedzi
2017-03-02 11:03 How to change any by all in active admin collection data? »
I am using collection for filter data. filter :"status" , :as => :select, :collection => User::STATUS I want to change default option label any ...
(1) odpowiedzi
2017-03-01 21:03 Rounding in Ruby (Rails) »
I don't know why this is so difficult, I am clearly using the wrong methods. But I am working with the Stripe API (everything works well) and I am try...
(2) odpowiedzi
2017-03-01 21:03 Rails form_for checkbox validation without record in database »
I'm trying to create an User register form that has to accept a set of terms and condition, but I don't know how to use the value of the checkbox to v...
(2) odpowiedzi
2017-03-01 21:03 Validate presence on after_create »
I have a User model: class User < ApplicationRecord # Include default devise modules. Others available are: # :confirmable, :lockable, :timeou...
(1) odpowiedzi
2017-03-01 16:03 NoMethodError (undefined method `created_at' for nil:NilClass) »
I have the following Rails code in my conversations_controller: A user may be : master or rookie. @conversations = current_user.master.conversation...
(1) odpowiedzi
2017-03-01 08:03 nested routes is working different in rails 3.2 and rail 4 »
I am using rails 3.2 and having the following routes resources :projects do resources :assessments end Now when I am using project_assessm...
(0) odpowiedzi
2017-03-01 05:03 Factory Girl: How to create record with has_one_through relationship? »
I have the following relationships as follows class LoanApplication < ActiveRecord::Base has_one :case_status, :dependent => :destroy has_...
(0) odpowiedzi
2017-02-28 16:02 Travis CI error on deploy to Heroku »
Hello Guys I'm using for the first time Travis CI and when i'm getting an error for deploy. The test with Spec works fine but when I watch on Travis f...
(1) odpowiedzi
2017-02-28 16:02 How to migrate existing data after adding polymorphic association? »
After migration my PageViewStats table contains 2 new empty columns: ad_templatable_id and ad_templatable_type. So if I try to query an existing recor...
(1) odpowiedzi
2017-02-28 16:02 Too long is displayed <select> in form »
Guys experiencing the issue with slow display of the input in form. In the variable @cities uploaded about 2 thousand cities, AR request is over the ...
(0) odpowiedzi
2017-02-27 21:02 Rails - Validation :if one condition is true »
On Rails 5. I have an Order model with a description attribute. I only want to validate it's presence if one of two conditions is met: if the curren...
(4) odpowiedzi
2017-02-27 20:02 Kaminari not respecting .per() setting »
@items = @cats + @dogs + @birds @pag_items = Kaminari.paginate_array(@items).page(params[:page]).per(9) puts @pag_items.count 6 The @items array ha...
(1) odpowiedzi
2017-02-27 18:02 Create constant outside of method »
I have a method test in a concern as below module company extend ActiveSupport::Concern included do def test(emp) employees = { '0' =&g...
(1) odpowiedzi
2017-02-26 21:02 Setting up associations / db references rails 4 »
I have a table called bills. Bills has_many sponsors and has_many cosponsors. Both sponsors and cosponsors contains a list of congress people. I also ...
(1) odpowiedzi
2017-02-26 18:02 Ruby On Rails - how to compromise the modularity of the code? »
I was in an interview for an internship last week and I was given a part of ruby on rails code of a controller. Then the interviewer asked me to "comp...
(0) odpowiedzi
2017-02-26 13:02 Rails how to hide only default locale in url, but show others »
Is it possible to hide the default locale in the url, but show the locale in the other languages? Say, 'de' is my default locale, my login url should...
(0) odpowiedzi
2017-02-26 08:02 create calls before_save multiple times »
I have a before_save callback in my model which encrypts 2 fields before they're saved to the database. class Account < ActiveRecord::Base befor...
(1) odpowiedzi