Data dodania Pytanie
2017-01-11 23:01 How do I merge parent array and one child with different attribute? »
I have comments and likes (acts_as_votable gem). I want to create one activity list and sort by created_at for comments and updated_at for votes. @ac...
(1) odpowiedzi
2017-01-11 22:01 rails has_many through with 5 tables »
I would like to know if is a good practice create a has_many through with more than 2 tables. for exemple: I have class Color < ActiveRecord::Bas...
(0) odpowiedzi
2017-01-11 22:01 heroku config on rails app suppressing logs on development env »
I am working on porting a rails 4.2 app from linode to heroku. I have the changes in a separate branch. When I am testing the app locally, the herok...
(1) odpowiedzi
2017-01-11 20:01 How to get a database entry with a specific language »
Using I18n for Ruby on Rails 4.0.0 I need a database entry for English, even though I'm currently in local => "de". The code is = link_to tag.name, :...
(1) odpowiedzi
2017-01-11 17:01 RAILS - ActiveAdmin disable comments delete? »
After integrating the ActiveAdmin panel, I tried to find where can I modifiy any options to remove the possibility to delete comments But I can't fin...
(1) odpowiedzi
2017-01-11 16:01 Ruby on Rails: Using functions to retrieve data from model »
In my RoR application I am trying to display information from associated tables on a view. I have tables with data such as this: Email id subje...
(1) odpowiedzi
2017-01-10 21:01 Rails Custom Authentication with internal jar security »
Our company uses a jar file with java code to authenticate users for access to internal websites. I have so far been able to integrate that jar file ...
(1) odpowiedzi
2017-01-10 21:01 Carrier Wave mini_magick_processing error »
I am trying to upload an image in my signup form using carrierwave gem but getting this error: Avatar translation missing: en.errors.messages.mini...
(0) odpowiedzi
2017-01-10 21:01 Generating the Error Page for a 422 Error »
I'm currently generating dynamic error pages for 500 and 404 errors. I want to expand this to 422 errors. Here's what we have so far. config/applicat...
(1) odpowiedzi
2017-01-10 20:01 Rails: get event name with sneakers »
I have this code: require 'json' class PaymentEvents < Workers include Sneakers::Worker from_queue "my-queue", exchange: 'payment', ...
(1) odpowiedzi
2017-01-09 21:01 Ruby on Rails: Add form for another model on a form »
Within my Ruby on Rails application I am trying to implement a relationship between Group and Contact, whereby one group can contain many contacts and...
(3) odpowiedzi
2017-01-09 15:01 How to create objects using rails polymorphic association »
I want to create objects using Polymorphic association but it returns me error like: NoMethodError (undefined method `new' for nil:NilClass): Here ...
(1) odpowiedzi
2017-01-09 12:01 How to get data from 2 tables based on search keyword rails »
I have 2 tables schools and private_schools and they are not related to each other. What I need to do is to search the data from both tables to popula...
(3) odpowiedzi
2017-01-09 01:01 How to list records of a Table with a counter of how many are used through a relationship »
I have these 2 tables: create_table "instruments", force: :cascade do |t| t.string "name" ... create_table "user_instruments", force: :c...
(1) odpowiedzi
2017-01-08 18:01 ruby on rails : <top (required)>': superclass must be a Class (Symbol given) (TypeError) »
In my rails server, this error occurs when I enter 'rails console production' and I don't know why. What I'm trying to do is generate user information...
(2) odpowiedzi
2017-01-08 16:01 Ruby on Rails update_attibutes not working »
I am trying to set an user as admin, the method is: def set_user_admin if admin_true? == true user = User.find(params[:format]) if us...
(2) odpowiedzi
2017-01-08 05:01 Ruby on Rails - Need Help Optimizing My horrible code involving multiple data models »
I am working on a personal project and I have hit a wall. I know I am writing bad code and I really wan to refactor the code below. The application ha...
(1) odpowiedzi
2017-01-07 22:01 Rails: How to include multiple web fonts into rails asset pipeline using bower? »
I want to include multiple custom web fonts to my rails asset pipeline and the fonts are not loaded. My folder structure: In my application.rb fil...
(1) odpowiedzi
2017-01-07 21:01 Rails Alternative to use polymorphic associations »
I've see that the polymorphic association break the rules of relational db design and in the end cause more harm to the app. so, the left alternative ...
(1) odpowiedzi
2017-01-07 05:01 undefined method `[]' for nil:NilClass on select_options [Filterrific Gem] »
Hi I am using Filterrific Gem to add searching and filtering functionalities for my users page. The Searching works just fine, but I got undefined me...
(2) odpowiedzi
2017-01-06 21:01 Rails 4 ActiveRecord::first not working »
I'm debugging some legacy code in a Rails 4.1 app and I'm seeing some confusing results from this: #order.rb # get the most recent order from the sa...
(1) odpowiedzi
2017-01-06 19:01 How to get build Rails ActiveRecord query to group objects that belong_to other model? »
Given the following models: ServiceCenter has_many :country_codes CountryCode belongs_to :service_center What is the ActiveRecord query that w...
(1) odpowiedzi
2017-01-06 13:01 How to create migration script for has_many, belong_to association between user and task model in ruby »
I have two model User and Task. Task would have one owner and other as workers. class Task < ApplicationRecord belongs_to :user has_many :...
(1) odpowiedzi
2017-01-06 10:01 render page after submission of a form in ror »
I have a form from which i select college_ids.when i select college_id, a query is executed and that result is sent to other form of different method....
(1) odpowiedzi
2017-01-05 22:01 Shorten mapping and concat »
I get an array with person objects. A person can have several houses: person.houses => ActiveRecord_Associations_CollectionProxy Some houses ca...
(2) odpowiedzi
2017-01-05 16:01 Rails 4: Advanced Query for Search Interface »
I need to perform a query on my model that allows me to test an array of tags (belongs_to :recipe) class Recipe < ActiveRecord::Base has_many ...
(1) odpowiedzi
2017-01-05 07:01 How to create a sequential unique id for a db field »
I have the table Slug with the field url which is unique. If I create @slug = Slug.url = "foo" When I go to save, if Slug.url of "foo" already exist...
(5) odpowiedzi
2017-01-05 05:01 Have access to multiple databases »
I am developing an application that at the beginning the user can select which database to connect to. It is a Rails application which uses Active-Rec...
(0) odpowiedzi
2017-01-05 00:01 Adding presence validation on existing records »
We have user records that have an attribute called first_name. Many of these records do no have the first_name attribute filled out and thus it equals...
(1) odpowiedzi
2017-01-04 16:01 Invalid Authenticity Token When Multiple Tabs Open »
I have a Rails 4.2 application. Several months ago we started experiencing Invalid Authenticity Token errors. I've discovered that the following scena...
(0) odpowiedzi
2017-01-04 13:01 has_many relationship using FactoryGirl »
I'm trying to create instance with has_many relationship using FactoryGirl factories and fail. I have two classes: Computers and NetworkCards. Each Co...
(2) odpowiedzi
2017-01-04 11:01 Rails TimeZone issue - Group query »
I have my server in NYC and the data in PostgreSQL is stored in UTC but all my data on the presentational layer is to be shown in IST I have the foll...
(0) odpowiedzi
2017-01-04 11:01 Rails and RSpec: Testing controllers with the same name in different namespace (module) »
I have rails 4.1.16 API application that is tested using RSpec 3.4.0, and I experience problems with testing classes called the same name in a differe...
(1) odpowiedzi
2017-01-04 00:01 How do I figure out what is causing Rails to require JSON 1.8.3? »
I'm using Ruby 2.4 on Mac Sierra. How do I figure out what Gem is requiring JSON 1.8.3? Although I haven't specified this gem in my Gmefile, shown b...
(2) odpowiedzi
2017-01-03 23:01 acts_as_follower issue with following users »
I have a User model created in devise: class User < ApplicationRecord # Include default devise modules. Others available are: # :confirmable, ...
(1) odpowiedzi