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 How do you trigger the evaluation of a mail method using RSpec? »
class MyMailer < BaseMailer def send_login_prompt User.reset_login # ... end end describe MyMailer do context "when sending a login ...
(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-11 05:01 How to test before_update callback in rails model with Rspec and FactoryGirl? »
I am trying to test the before_update callback of the model bellow. models/option.rb: class Option < ApplicationRecord belongs_to :activity ...
(3) odpowiedzi
2017-01-11 02:01 Rails: too many methods in model »
TL;DR: I don't know how organise my logic domain classes. I have the model "Application", this model is in the "core" of the App and is the way I "e...
(3) odpowiedzi
2017-01-11 01:01 How To Test Sending Thousands Of Emails »
I'm developing an application that will send thousands of emails per day based on a CSV file using Amazon SES. My client would like to send around 5...
(3) odpowiedzi
2017-01-10 22:01 ActiveRecord Rollback when trying to save to database »
I am building a fairly simple album review application. I am attempting to set up a simple_form for new reviews. The change will not stick. This is wh...
(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/ActiveRecord has_one association behavior when setting child to "nil" »
My colleagues and I noticed something about ActiveRecord has_one associations that feels wrong/dangerous and doesn't seem to be readily documented. S...
(2) odpowiedzi
2017-01-10 20:01 rspec rails nested_attributes on controller »
I am using Rspec to test a controller that received nested_attributes. A class Option can has_many Suboptions. models/suboption.rb: class Suboption ...
(0) 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-10 16:01 ActionView::Template::Error "Invalid CSS" thrown in feature spec only »
The following Sass works perfectly in development: main :not(table) img +box-shadow But when I run my specs, as soon as a JavaScript feature ...
(0) odpowiedzi
2017-01-10 16:01 Ruby on Rails - where query with Time parse »
How can I select all records where the date is past? I have "Date" column with format : '%m/%d/%Y' e.g "01/10/2017". Column type is string, I can't c...
(3) odpowiedzi
2017-01-10 14:01 wicked_pdf shows unknown character on unicode pdf conversion (ruby) »
I'm trying to create a pdf from a html page using wicked_pdf (version 1.1) and wkhtmltopdf-binary gems. My html page contains a calendar emoji that di...
(1) odpowiedzi
2017-01-10 14:01 Can't create model on ruby on rails »
I'm starting to learn ruby on rails. the problem that i have is that i don't know why i get there while i want to create model this is the command th...
(5) odpowiedzi
2017-01-10 13:01 Unable to create a model in Rspec via Post »
I'm trying to create a User in Rspec: require "rails_helper" RSpec.describe UsersController, type: :controller do describe "POST #index" do it...
(1) odpowiedzi
2017-01-10 10:01 Redirect with cookies »
Is it possible to redirect to other domain with cookies? I tried followong. def test_redirect response.headers['Cache-Control'] = 'no-cache, no-sto...
(1) odpowiedzi
2017-01-10 06:01 Creating a list or array of objects in Ruby on Rails »
I am trying to make it possible for the users of a web application I am building to create lists of objects that they have created. For example, the ...
(2) odpowiedzi
2017-01-09 23:01 Run Rails controller before_action callback after others »
Is there a simple way to append to the before_action list for a controller in rails, such that other before_action callbacks added later will run befo...
(1) odpowiedzi
2017-01-09 23:01 ActiveRecord read replica for reporting queries »
I have a Rails/ActiveRecord application that occasionally executes some heavy read-only queries against the application's models for ad-hoc admin/repo...
(0) odpowiedzi
2017-01-09 22:01 What does f.object do in the Rails form builder? »
I am learning Rails 5.0 from a tutorial, and in that tutorial it uses f.object, which I am unfamiliar with. The f.object is being passed into ERb, int...
(3) 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 11:01 Redmine : error in running redmine_wktime plugin : rufus-scheduler-3.0.3 »
I'm using redmine 3.3.1 and i wanna install the plugin "redmine_wktime" DOCUMENTATION of the plugin : https://github.com/dhanasingh/redmine_wktime, ...
(1) odpowiedzi
2017-01-09 11:01 rails mysql regex input not getting sanitized properly »
I am doing the following on a rails 3 app def test(str) User.where("name REGEXP ?",str).last end Using the format above, rails generally handle...
(1) odpowiedzi
2017-01-09 04:01 Rspec: controller spec login helper »
I am using rspec to test my controllers. The problem is that I need a login helper method every other controller tests will use in its before(:each) d...
(0) odpowiedzi
2017-01-09 02:01 What exactly was initialize_on_precompile used for? »
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 ...
(1) odpowiedzi
2017-01-08 23:01 Why in Rails table fields are defined in migrations but not in models? »
I am studying Ruby on Rails and confused with structure of files and code.. Why in Rails table fields are defined in migrations but not in models? I k...
(1) odpowiedzi
2017-01-08 21:01 Add custom directive for strftime in ruby »
I would like to add a %custom directive to strfime that will translate months to the code used in some financial/trading reports January => F Feb...
(1) odpowiedzi