Which version of this gem am I using?

I updated the shopify_api gem in my gem file to this: gem 'shopify_api', '~>4.9' When I do gem list I get shopify_api (4.9.0, 4.3.2, 4.0.7) When I do bundle show shopify_api I get /home/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sh...
more »

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

Preventing caching a random SQL query in Rails

I'm trying to choose a random track but want it to avoid matching a specific record. This is my code, but it keeps returning the CACHE of the query so that the while loop never ends. current_track = Track.find(10) random_track = Track.limit(1).orde...
more »

2017-08-10 17:08 (2) 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

Inline CSS is not working with gem 'htmltopdf'

My requirement is to download docx file and should be open on Microsoft word: I am using following gems: gem 'responders' gem 'htmltoword Controller code: require 'htmltoword' class Admin::VisibilitiesController < ApplicationController resp...
more »

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

Rails scope doesn't return correct data

When I use scope which I prepared in model, rails returns incorrect data. My Model: class CurrencyRate < ActiveRecord::Base scope :eur_today, -> {where(currency: "eur").where(date: Time.now.in_time_zone.to_date).first} end Inforamation ...
more »

2017-08-09 22:08 (1) Answers

Ruby version issue with ttfunk

While attempting to install asciidoctor-pdf (sudo gem install asciidoctor-pdf --pre) I'm getting the error ttfunk requires Ruby version ~> 2.1. I've attempted to uninstall, reinstall, and update Ruby & Ruby gems multiple times and this messa...
more »

2017-08-09 20:08 (1) Answers

bundle install gem could not find unf_ext

A test project I'm trying to get working has a dependency on the unf_ext gem being installed and I'm having trouble with it. If I run bundle install I get: <some packages> Using unf_ext <some package> Bundle complete! 6...
more »

2017-08-08 17:08 (0) Answers

URL Signing with AWS Cloudfront - Ruby

My main purpose is to sign the URL using AWS Cloudfront in Ruby I Have created a key pair at https://portal.aws.amazon.com/gp/aws/securityCredentials (Key Pairs tab). Which provided with a key pair id and a pem file (save the pem file in your projec...
more »

2017-08-08 10:08 (0) Answers

Rails 4 bulk updating array of models

I have an array of ActiveRecord model and I want to renumber one column and bulk update them. Code looks like this: rules = subject.email_rules.order(:number) rules.each_with_index do |rule, index| rule.number = index + 1 end EmailRule.update(rul...
more »

2017-08-07 15:08 (2) Answers

Ruby On Rails Notifications User Edit

I did notifications it using this site : https://www.devwalks.com/lets-build-instagram-part-6-notifications/ I have notifications in navbar on every page. Everything works fine but when i go to edit user who has one or more notifications i get issu...
more »

2017-08-07 11:08 (1) Answers

Rails: How to make recent blog posts appear first

I'm creating a blog app with ruby on rails. I was able to allow a user to add posts, but on the top of the page, the posts that were created first appear first. I want the most recent blog posts to appear first. How do I do this? Let me know which co...
more »

2017-08-06 18:08 (3) 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

Exclude model from Railroady digram

I am trying to create an ER diagram for my project using RailRoady. I am also using PaperTrail gem. because of this my ERD is all messed up. Is there any way to exclude PaperTrail::version table from ERD? I went through following issue but couldn't...
more »

2017-08-04 16:08 (0) Answers

Trouble using font-awesome-rails with a HAML file

I am currently trying to change from an existing svg file in the following section of a HAML file: .pokecon-btn-search-lg %i.btn.w100= image_tag "icons/search_white.svg", class: "pokecon-img-icon-search" %input.pokecon-btn-search-lg-submit{typ...
more »

2017-08-04 11:08 (2) Answers