Data dodania Pytanie
2017-01-13 08:01 Why are Ruby's file related types string-based (stringly typed)? »
e.g. Dir.entries returns an array of strings vs an array containing File or Dir instances. Most methods on Dir and File types. The instances are aneam...
(2) odpowiedzi
2017-01-13 02:01 Add concerns module to Model »
I have a model class called Person. The person class has a attribute called car. Now I would like to define a module in the concerns model called Per...
(1) odpowiedzi
2017-01-13 01:01 Rails where use lru_redux gem »
Lru_redux seems interesting to boost the speed apps but the documentation is vague, so, someone have a idea how or where to use this lru_redux gem? ...
(0) odpowiedzi
2017-01-12 23:01 TDD implementation of a set data structure in Ruby »
I am trying to implement a set data structure in Ruby using rspec. I have one test which does not seem to pass in the below code: def add(element) ...
(2) odpowiedzi
2017-01-12 21:01 Install ImageMagick and rmagick on Windows 7 »
I am trying to install ImageMagick and a ruby library binding for it called rmagick onto a windows machine to use with rails + paperclip. I am current...
(1) odpowiedzi
2017-01-12 18:01 ActionController InvalidAuthenticityToken in Api::V1::UsersController#create »
I'm going to create restful API using Ruby on Rails. I want to create, delete, show and update data. All of them should have to be JSON to get it i...
(1) odpowiedzi
2017-01-12 18:01 Rails 4.2 app very slow in development »
I've been banging my head against the wall on that one for a couple of days now. My app is running super slow in development mode. A good amount of ti...
(0) odpowiedzi
2017-01-12 17:01 What are the conventions for types in Ruby? »
Being that Ruby is a language with purely dynamic types, I'm never quite sure what level of expectation I should have for the types passed to my metho...
(4) odpowiedzi
2017-01-12 17:01 How to build an array given a dynamic list of variables? »
Given a very long list of colors, for now lets say 3: ["red", "green", "blue"] How can I iterate over a string and do the following, match XXXX an...
(2) odpowiedzi
2017-01-12 13:01 Nested Loop: to be dynamic? »
Ok i'm actually doing this exercise to tackle those nested loop questions. I would say this would be the hardest one for me. I tried my best to be mor...
(2) odpowiedzi
2017-01-12 11:01 How to get each value from hash of array? »
I have a hash of array with key, values in ruby which I want to pass each value with key. I want to extract content using my hash. My code is : ...
(4) odpowiedzi
2017-01-12 05:01 Ajax for post upvote/downvote (stopping page refresh) »
I'm using "acts_as_votable" gem in my Rails application so that Users can vote on Posts. I'm trying to add Ajax functionality so that the entire page ...
(2) odpowiedzi
2017-01-12 02:01 How to create a new record using the values from a variable already under the same class »
I remove records all the time to test, and need to re-create the same record to test again. So doing this: User.create(name: "Peter", col1: "etc", ...
(3) odpowiedzi
2017-01-12 01:01 Passing jpg file directly on from backend server »
I'm uploading an image file from my app via JSON to my ruby backend hosted by Heroku. It is then supposed to be passed to stripe via their gem via a p...
(0) odpowiedzi
2017-01-11 23:01 Test production specific code with rspec - Sinatra »
I have this code to configure logging for production and test/development environments: class ApplicationController < Sinatra::Base configure :d...
(1) odpowiedzi
2017-01-11 23:01 How do I merge parent array and one child with different attribute? »
I have comments and likes (acts_as_votable gem). I want to create one activity list and sort by created_at for comments and updated_at for votes. @ac...
(1) odpowiedzi
2017-01-11 22:01 rails has_many through with 5 tables »
I would like to know if is a good practice create a has_many through with more than 2 tables. for exemple: I have class Color < ActiveRecord::Bas...
(0) odpowiedzi
2017-01-11 20:01 Highest unique prime factors in range »
I am trying to scale a solution I have to a Hackerrank practice question. The question, in summary is, find the max number of prime factors in a rang...
(2) odpowiedzi
2017-01-11 19:01 Sinatra Github OAuth Problems »
I am using the sinatra_auth_github gem to try and put GitHub OAuth into my Sinatra app. I was testing using the sinatra-auth-github-test example app f...
(1) odpowiedzi
2017-01-11 17:01 Facebook::Messenger::Bot::RecipientNotFound »
I'm trying to build a messenger bot using the facebook messenger gem provided by Hypersolo: https://github.com/hyperoslo/facebook-messenger I always...
(1) odpowiedzi
2017-01-11 16:01 Ruby on Rails: Using functions to retrieve data from model »
In my RoR application I am trying to display information from associated tables on a view. I have tables with data such as this: Email id subje...
(1) odpowiedzi
2017-01-11 09:01 Ruby programmatically calling method, with variable number of args »
I am trying to do something similar to this: def foo(mode= :serial) if (mode == :serial) then self.send(:bar, "one_type") else self.sen...
(3) odpowiedzi
2017-01-11 03:01 Memory leak after algorithm in Rails? »
I wrote an algorithm inspired by the merge part of the merge sort. def self.merge(arr) if arr.length == 1 return arr end groups =...
(1) odpowiedzi
2017-01-11 02:01 Rails: too many methods in model »
TL;DR: I don't know how organise my logic domain classes. I have the model "Application", this model is in the "core" of the App and is the way I "e...
(3) odpowiedzi
2017-01-10 23:01 Chain an array of tasks in Concurrent Ruby »
I have a set of tasks that I want to execute sequentially in some background thread, with the result of each task being passed to the next, and with t...
(1) odpowiedzi
2017-01-10 21:01 Rails Custom Authentication with internal jar security »
Our company uses a jar file with java code to authenticate users for access to internal websites. I have so far been able to integrate that jar file ...
(1) odpowiedzi
2017-01-10 21:01 Carrier Wave mini_magick_processing error »
I am trying to upload an image in my signup form using carrierwave gem but getting this error: Avatar translation missing: en.errors.messages.mini...
(0) odpowiedzi
2017-01-10 21:01 Generating the Error Page for a 422 Error »
I'm currently generating dynamic error pages for 500 and 404 errors. I want to expand this to 422 errors. Here's what we have so far. config/applicat...
(1) odpowiedzi
2017-01-10 20:01 Rails/ActiveRecord has_one association behavior when setting child to "nil" »
My colleagues and I noticed something about ActiveRecord has_one associations that feels wrong/dangerous and doesn't seem to be readily documented. S...
(2) odpowiedzi
2017-01-10 20:01 Rails: get event name with sneakers »
I have this code: require 'json' class PaymentEvents < Workers include Sneakers::Worker from_queue "my-queue", exchange: 'payment', ...
(1) odpowiedzi
2017-01-10 19:01 Rails 5 Faraday connection for Facebook Omniauth »
I have tried all the tricks in the book and all the possible solution in stack over flow.But still couldn't figure out the problem. The program pauses...
(0) odpowiedzi
2017-01-10 16:01 Ruby on Rails - where query with Time parse »
How can I select all records where the date is past? I have "Date" column with format : '%m/%d/%Y' e.g "01/10/2017". Column type is string, I can't c...
(3) odpowiedzi
2017-01-10 14:01 wicked_pdf shows unknown character on unicode pdf conversion (ruby) »
I'm trying to create a pdf from a html page using wicked_pdf (version 1.1) and wkhtmltopdf-binary gems. My html page contains a calendar emoji that di...
(1) odpowiedzi
2017-01-10 14:01 Can't create model on ruby on rails »
I'm starting to learn ruby on rails. the problem that i have is that i don't know why i get there while i want to create model this is the command th...
(5) odpowiedzi
2017-01-10 13:01 Get a random non repeating element of an array in ruby »
I have an array of questions and I want to get a non-reapting random one out of them. So for instance 5 questions, and if asked all i will simply star...
(5) odpowiedzi