Skip to main content

Community

Subscribe to GoRails to join the conversation. Ask questions about your code, get help adding a new feature, and discuss implementation details with other members.

4 posts Gravatar

Optimizing Queries in Service Objects

Ruby • 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...


3 posts Gravatar

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. ✨ ...


3 posts Gravatar

Proper location for null objects

Ruby • Asked by Alex Musayev

I've recently watched couple of screencasts on using Null Object Pattern: https://www.rubytapas.com/2017/01/31/two-screencasts-two-ways-eradicate-ruby-nil-values It was a good reminder about a ques...


9 posts Gravatar

How can I subscribe a user when creating a new project?

Ruby • 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 ...


4 posts Gravatar

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...


4 posts Gravatar

Retrieve all Project Threads where a given users has posted a Project Post

Ruby • Asked by Lauro Silva

A user belogns to a ProjectThread. And a ProjectThread has_many Users through ProjectPosts. On the Project Thread Index I want to display only threads where a given users has posted a Project P...


8 posts Gravatar

How do I iterate over an array of nested hashes in a view?

Ruby • Asked by Premila Anand

I have an array that has nested hashes of months, years and amounts that I want to diplay in a table. My data is in this format: [{:month=>"January", :years=>{2017=>20, 2018=>100, 2019=>300}}, ...


4 posts Gravatar

Install Ruby from binaries on production: do or do not?

Ruby • Asked by Alex Musayev

I'm using rbenv with ruby-build plugin as a default way to install ruby for development and production environments. Is there a way to make installation process faster, but keep it stable? For e...


5 posts Gravatar

Ruby version stuck on macOS

Ruby • Asked by RJ McCollam

Setting up my new MacBook Pro and am running into an issue with ruby versions. At this point I have installed and am usin rbenv. I installed ruby 2.3.1 and when I `ruby -v` that is what it shows...


4 posts Gravatar

CSV Import

Ruby • Asked by Sascha M.

My question is about this Episode: https://gorails.com/episodes/upload-csv-form The CSV Import works fine (I'm using the exact same code actually). My 1. Question - How can I define an alias ...