Skip to main content
How to count comments like reddit (infinite nested model) ?
Ruby Solved • Asked by Robert Hopman
Hey Chris, I have an `item` model which gets submitted. With `has_many :comments, as: :commentable, dependent: :destroy` then in the `comment` model I have `belongs_to :commentable, pol...

Ruby on Rails or Node.JS, who is the leader of 2017?
Ruby • Asked by alexblack
Finally, [Ruby on Rails vs Node.js]( – who seems to be really better? Frankly, Ruby On Rails is still a popular framework and loved by a lot of de...

Ruby • Asked by roberto santelices
I have trouble solving the following excercise, i was wondering if there is any way in ruby where i can get which method called which i think caller but i havent figured out yet ``` require_re...

Chat Using Action Cable part 3 - Chatroom and ChatroomUsers Association
Ruby • Asked by RicePad
I've been playing around and trying to implement a chat such as slack as shown on Chris's screencast. On Chatroom index I'm able to Show, Edit, Join, and Leave. However, when I clicked on Show e...

How do I add the amount stored in my database to Braintree::Transaction.Sale?
Ruby • Asked by RicePad
Hi all, I'm new to this community and also new to Ruby on Rails. I recently watched the Braintree integration screencast by Chris and I've been playing around with its Sand box integration. I ...

Optimizing Queries in Service Objects
Ruby Solved • Asked by Jacob Warren
I'm currently building an app and using namespaced service objects containing a single call method in each class. Below is an actual method (I'm aware the ABC size is too large, I'm wanting to g...

Regexp for prices or how to detect price in a smart way
Ruby • Asked by Jack
Any regexp experts here? I have the following situation: - get an invoice - scan it for prices and save the highest number - success 🍾 I do this with a `.scan(/…/)`. Pretty fast in Ruby. ✨ ...

Proper location for null objects
Ruby Solved • Asked by Alex Musayev
I've recently watched couple of screencasts on using Null Object Pattern: It was a good reminder about a ques...

How can I subscribe a user when creating a new project?
Ruby Solved • Asked by Lauro Silva
**How can I subscribe a user when creating a new project?** I'm having a hard time on the `create` method. Currently this is my code: ### Projects controller ```ruby def create ...

Error running Rails with Ruby 2.4.0
Ruby • Asked by Menj Villalobos
``` [Menj]~/RubymineProjects/myapp2$ rails s /Users/Menj/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-5.0.1/lib/active_support/xml_mini.rb:51: warning: constant ::Fixnum is deprec...