Data dodania Pytanie
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
2017-01-03 15:01 Syntax error on empty line »
I have the following error showing, not sure what went wrong... /home/ubuntu/section3/alpha-blog/app/views/users/_form.html.erb:39: syntax error, une...
(1) odpowiedzi
2017-01-03 13:01 Ruby Unable to map values to array of hash, searching for alternative »
I have an array of hashes: data1 = [{:first => 1, :second => 'whatever'},{:first => 2, :second => 'something'}] test_merge = {'whatever'...
(3) odpowiedzi
2017-01-02 23:01 Error while queueing an email with Sidekiq »
When sending an email with sidekiq as a queue using deliver_later. I'm getting this error: ActiveJob::DeserializationError: Error while trying to...
(1) odpowiedzi
2017-01-02 23:01 Rails: ActiveRecord::StatementInvalid in »
I'm trying to GET all Activities (belongs_to :student) related to a Student (has_many :activities) using this in my controller: @activities = Activi...
(3) odpowiedzi
2017-01-02 19:01 Rails Ajax - View Filtering by joined record »
I'm trying to allow an end user to filter a data grid by an associated record. The data grid is showing a list of Activities: Model for activity.rb ...
(3) odpowiedzi
2017-01-02 13:01 how do I change environments in ruby on rails »
At the moment, I am unable to run my server because apparently I seem to be in the wrong environment. Suppose I am in the test environment, how do I ...
(2) odpowiedzi
2017-01-02 03:01 SystemStackError (stack level too deep) when jQuery ajax post »
I have a form and when user enters some value in a text field i want to autofill other fields, but it keeps returning SystemStackError (stack level to...
(1) odpowiedzi
2017-01-01 13:01 Icon within a link_to tag with <a> tags »
I have a navbar button: <%= link_to new_post_path do %> <a class="btn-navbar"><i class="fa fa-plus" aria-hidden="true"></i>...
(2) odpowiedzi
2017-01-01 11:01 Access data with through option on models »
"Hi guys!" I'm currently working with a project on Rails. I have three tables. class CreateDoctors < ActiveRecord::Migration def change crea...
(2) odpowiedzi
2017-01-01 02:01 Random ActiveRecord::StatementInvalid errors on Rails 4 app on Heroku »
My Rails 4 app works fine locally, and also when it's deployed to Heroku in production mode... until I access the app from a second client... then aft...
(1) odpowiedzi
2016-12-31 21:12 NOT NULL constraint failed created_at when saving model »
I'm getting an exception when I call save! in a model. SQLite3::ConstraintException at /contacts/import_spreadsheet/1/import NOT NULL constraint...
(0) odpowiedzi
2016-12-31 20:12 fields_for equivalent in android for rails api for nested attributes »
There are two models: User, Address. relationship: has_one class User < ApplicationRecord has_one :address accepts_nested_attributes_for ...
(0) odpowiedzi