twilio and rails 5.1 compatibility

I created a brand new rails 5 app with nothing but the skeleton. When I created a simple welcome controller/home page the server ran fine. But when I added gem 'twilio-ruby' to my app, everything broke down. I wasn't able to run the server, I wasn't...
more »

2017-09-23 06:09 (1) Answers

Rails, how to dynamically build a Hash dataset

I'm working to build a chartjs data object that contains a dynamic number of datasets... In my Ruby on Rails 5 controller, I'm trying the following: chartJsObject = [] chartJsObject << { label: "Label Stuff", datasets: [] } i = 0 num = 5...
more »

2017-09-21 17:09 (1) Answers

Rails 5: can't order after group and count

In my subscribers table I have duplicate emails, so I want to count these. I'm doing this in the Rails console:"email, count(*)").group(:email).order("count (*) desc") This results in the following query to my PostgreSQL db: SEL...
more »

2017-09-19 15:09 (1) Answers

RuntimeError: can't modify frozen Array

I updated my Ruby on Rails app to Ruby on Rails 5.1.4. When I run my tests it returns me following error: An error occurred while loading ./spec/views/surveys/results.html.haml_spec.rb. Failure/Error: require File.expand_path('../../config/environme...
more »

2017-09-15 14:09 (0) Answers

Has Rails 5 a dependency on Git?

We migrated our app from Rails 4 to Rails 5. We run it inside Docker. On our host system we of course have the git binaries, but not inside Docker. Running Puma inside Docker will give this error message, and I would like to get rid of it: bin/rails...
more »

2017-09-09 23:09 (1) Answers

Add Filter To ElasticSearch Query

I'm trying to create a query where the user can search for ES documents where the brand field is equal to some string. Here is the query I currently have that works but has no filtering. I'm using elasticsearch-rails with Ruby on Rails. @products =...
more »

2017-09-08 17:09 (2) Answers

Brackets showing posts info in rails?

l am following a ruby on rails tutorial. I am having my posts info show up in brackets beside the caption on the posts. if you know how to fix it, please help! Example=> "first post on PHOTOGRAM! [#<Post id: 1, caption: "first post on PHOT...
more »

2017-09-04 02:09 (1) Answers

rails 5, remote: true form empty data

I am trying to migrate Rails 4.2 application to Rails 5.1. In rails 4.2 we heavily used JQuery. At the moment I am struggling to make the forms, with remote: true attribute work properly. As an example this is a simple form where user select the coun...
more »

2017-08-10 16:08 (1) Answers

Override the global index_errors option

I have configured application.rb with the following option to add an index to errors on nested models: config.active_record.index_nested_attribute_errors = true I have many models and it works great, but I want to change this behavior in a single ...
more »

2017-08-05 03:08 (1) Answers

Rails Social Links Model

I'd like to store user's social profile links: facebook, youtube, instagram, etc. Is there a gem that has this model already set up, or should I create my own? If I have to create my own I'd create a polymorphic model/migration and re-use the share...
more »

2017-08-03 19:08 (1) Answers

Ruby On Rails Users Ranking

I have app with gem acts_as_votable. Every post created by user has upvotes and downvotes. I am using Sqlite3 on test and Postgresql on development, production. posts_controller.rb class PostsController < ApplicationController def upvote @pos...
more »

2017-08-03 15:08 (3) Answers

Rails: Nested form for many-to-one relation

I have two models: Interview and Interviewee. There is a many to one relation between Interview and Interviewee. I want to be able to add a new Interviewee when creating a new Interview using /interviews/new route. If the Interviewee was already pr...
more »

2017-07-31 15:07 (1) Answers

Ruby on Rails 5, Country Flags

Just to begin with, I want to apologize for my inexpertise. I'm still in the process of learning RoR. I'm currently attempting to practice building a semi-advanced website, which is one big step, but I've made a lot of progress. I'm currently sitti...
more »

2017-07-30 23:07 (2) Answers

Couldn't find Resturant with 'id'=5

I am building this app and nested the reviews inside the restaurants. i have set all the permisions so only the users who are the owner of the review can delete their reviews. when i delete the review , the restaurant also gets deleted and i get this...
more »

2017-07-30 22:07 (1) Answers

Sidekiq not finding object in worker

When I create a new User in my app, I run an after_create method which then asynchronously triggers a Sidekiq worker. This worker ... def perform user_id @user = ::User.find user_id # ... end ... always returns the following error: Ac...
more »

2017-07-27 00:07 (1) Answers