Data dodania Pytanie
2017-08-07 14:08 delete files from Google Drive Service account with the google drive gem »
We created a synchronizer plugin for discourse and it should synchronize backups to the google drive service account. In order to keep the admin's goo...
(0) odpowiedzi
2017-08-06 20:08 How can I use Git to identify function changes across different revisions of a repository? »
I have a repository with a bunch of C files. Given the SHA hashes of two commits, <commit-sha-1> and <commit-sha-2>, I'd like to write ...
(2) odpowiedzi
2017-08-06 18:08 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 app...
(3) odpowiedzi
2017-08-06 15:08 Ruby - CSV Import split data into different tables »
I'm trying to import a csv file with a rake task. The csv looks like this model,brand,type,engine,price,doors Corsa,Opel,cupe,1100,14500,2 Corsa,Opel...
(1) odpowiedzi
2017-08-06 15:08 InvalidURIError when useing httparty post method and get the some field through users »
InvalidURIError (bad URI(is not URI?): https://api.flightstats.com/flex/schedules/rest/v1/json/from/VNS/to/DEL/departing/2017/ ...
(1) odpowiedzi
2017-08-06 14:08 Run a ruby on rails job every night at a specific time »
I have a job like this : class LdapSyncJob < ApplicationJob queue_as :default require 'pp' def perform users = User.all users.each d...
(1) odpowiedzi
2017-08-06 04:08 Unicorn+Sinatra+Nginx | FATAL error adding listener »
I have a Sinatra application hosted using Nginx and Unicorn. it went down when I upgraded the operating system (Ubuntu 14.04.5 LTS) on the server, and...
(2) odpowiedzi
2017-08-05 23:08 Ruby: deleting object while looping over list with that object »
So I have multiple lists to keep track of objects in a 2D game, but if these objects go off screen I want to remove these objects so they are no longe...
(1) odpowiedzi
2017-08-05 17:08 .sum data from query »
I'm trying to .sum a field from the following query: def self.busqueda_general(params) query = select('venta.Id,venta.TOTAL') .distinct ...
(2) odpowiedzi
2017-08-05 15:08 Rails ActiveRecord::InvalidForeignKey in ArticlesController#destroy »
ActiveRecord::InvalidForeignKey in ArticlesController#destroy SQLite3::ConstraintException: FOREIGN KEY constraint failed: DELETE FROM "articles" WHE...
(2) odpowiedzi
2017-08-05 10:08 Rollback transaction on pressing create button and fetching the value field to insert it into the form_for »
ERROR Started POST "/products" for 127.0.0.1 at 2017-08-05 01:23:20 -0700 Processing by ProductsController#create as HTML Parameters: {"utf8"=>...
(2) odpowiedzi
2017-08-05 08:08 Java encryption/decryption to Ruby »
I have snippet of code in Java responsible for Encryption and Decryption and need to convert in Ruby. Before posting here I gone through 4 Link but no...
(2) odpowiedzi
2017-08-05 05:08 Algorithm - longest wiggle subsequence »
Algorithm: A sequence of numbers is called a wiggle sequence if the differences between successive numbers strictly alternate between positive ...
(4) odpowiedzi
2017-08-05 03:08 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_er...
(1) odpowiedzi
2017-08-04 17:08 Showing random Product images from same category as the selected product is in. ROR app »
I'm modifying a Rails app I've been working on. I installed a model images.rb to handle all images for products. When the user has selected a produc...
(1) odpowiedzi
2017-08-04 17:08 "comparison of Date with ActiveSupport::TimeWithZone" fails consistently after about two months in prod »
In a production app, the following code works in dev and (initially) in production: @employee.ident_expiration_date && @employee.ident_expira...
(0) odpowiedzi
2017-08-04 16:08 Install chromedriver using a remote host »
I deployed my application using Ruby, Sinatra and Redis DataBase, on my ubuntu remote host named Scaleway. In this way, i've install all what i need,...
(1) odpowiedzi
2017-08-04 16:08 install ice on by brew error »
Install Ice by Homebrew,and i got some errors as follows: ➜ ~ brew install zeroc-ice/tap/ice Tapping zeroc-ice/tap Cloning into '/usr/local/Home...
(1) odpowiedzi
2017-08-04 16:08 How to redirect a URI with a parenthesis in Ruby on Rails »
I'm trying to do a redirect in Rails 4 get '/something)', to: redirect("/something", status: 301), format: false This doesn't work because parenth...
(1) odpowiedzi
2017-08-04 15:08 Second regex match statement get an error in Ruby »
While this code run perfectly: def center2 (a) c = a.match('(?<=A).*$') return c end Why this code got an error: def center2 (a) b = a.ma...
(2) odpowiedzi
2017-08-04 15:08 Given a Rails 5 has_and_belongs_to_many, how to create a join record? »
I have the following schema: class Industry << ApplicationRecord has_and_belongs_to_many :departments end # Relationship table: departments_...
(1) odpowiedzi
2017-08-04 13:08 Why using POST method in a form returns Error 404? »
I am completely newbie in ruby, so I made a form with POST http method, but it fails as follows: ruby sinatra_msg.rb [2017-08-04 07:47:50] INFO WE...
(1) odpowiedzi
2017-08-04 13:08 Getting a NameError (undefined local variable or method `“_”') »
I am trying to initialize a collection through c = Collection.new(name: current_user.account.name + "_" + @form.form_name, description: @form.form_n...
(1) odpowiedzi
2017-08-04 05:08 How to select rows covering today's day and month in pg / Rails »
So I have this table called SeasonRate create_table "season_rates", force: :cascade do |t| t.string "title" t.datetime "from_date" t.datetime...
(1) odpowiedzi
2017-08-04 04:08 How to track the User Activity in Ruby on Rails »
Is there any Gem or Method, which tracks the user behaviour on the site like whether the user has made the purchase of the site by landing on the doma...
(1) odpowiedzi
2017-08-03 20:08 Rails 3 to Rails 5 migration ActiveRecord issue »
Rails upgrade from 2.3.8 to 5.1.2 with Jruby ActiveRecord issue when upgrading gem 'activerecord-jdbc-adapter' I started to work as a junior Rails d...
(0) odpowiedzi
2017-08-03 20:08 How do I run a calculation in my ruby on rails model before the view is rendered? »
I have an application where users complete a number of tests. The results of these tests is then stored in the database. class TestOne < ActiveRec...
(1) odpowiedzi
2017-08-03 19:08 Displaying multiple paperclip images from database in ROR app. many relations »
I'm very new to ROR and I'm building an ROR app where each product can have many images. Im using paperclipfor the image upload. To do that I added ...
(1) odpowiedzi
2017-08-03 19:08 rspec How to test if my yield is called »
I need to test that my method is yielding correctly, the implementation is something like def method(val) @attr = yield(val) end I wrote my tes...
(1) odpowiedzi
2017-08-03 17:08 Rspec is calling the original method instead of the mock »
I have an issue with rspec whereby an external object is created from within a method, and instead of using the mock of that object, the actual object...
(0) odpowiedzi
2017-08-03 12:08 syntax error, unexpected '}', expecting keyword_end } »
I am new to Ruby, I don't quite get what is happening here, This code works chrome = Watir::Browser.new:chrome firefox = Watir::Browser.new:firefox...
(4) odpowiedzi
2017-08-03 05:08 Ruby method unable to pass Rspec test »
I am trying to create a method that takes in a user input. It turns that user input into an integer, it then subtracts one from the user input. It als...
(2) odpowiedzi
2017-08-03 05:08 add attribute to .create in rails »
Lets say im saving an array into my model. Is there any way to add an attribute to it? I am running Property.create(property_params) to save the inst...
(2) odpowiedzi
2017-08-03 04:08 performing activejob in rails with action cable »
i just wanna using rails active job to make a queue job for my actioncable channel, but unfortunately it doesn't work :( this is my activejob rails s...
(0) odpowiedzi
2017-08-03 02:08 Ruby NoMethodError: undefined method `messages' for []:Array »
Since google did not help me in my quest to figure this out, I figured I would share it for anyone else that runs into this problem: When attempting ...
(1) odpowiedzi