Data dodania Pytanie
2017-02-07 16:02 Does Ruby have a `Pair` data type? »
Sometimes I need to deal with key / value data. I dislike using Arrays, because they are not constrained in size (it's too easy to accidentally add m...
(3) odpowiedzi
2017-02-07 14:02 Why does random work like this in Ruby? »
I was trying to be clever about deterministically picking random stuff, and found this: irb(main):011:0> Random.new(Random.new(1).rand + 1).rand =...
(1) odpowiedzi
2017-02-07 14:02 How to resize VM disk with RbVmomi in Ruby »
I'm working on a project where I'm cloning a VM with RbVmomi and after the clone is finished I want to ReConfig the VM. The cloning is working great...
(2) odpowiedzi
2017-02-07 01:02 Ruby dynamically assign numbered variables »
I cant find a similar question, but I'm sure it's out there somewhere so please point me in the direction if it is. I'm writing an rspec test and want...
(1) odpowiedzi
2017-02-07 00:02 How validate Model with before_filter? »
I want to make the validation of the Model and move it to before_filter. How in the filter can be assigned to the standard validators presence, etc.? ...
(0) odpowiedzi
2017-02-06 23:02 Getting "incompatible character encodings: UTF-8 and ASCII-8BIT" error when displaying user entered ASCII-8BIT character »
A user saves text in a form with the word "café," (note the "é"). When loading the #show page displaying this text, I get an Encoding::Compatibility...
(1) odpowiedzi
2017-02-06 22:02 Is there a reliable Command Line or Powershell step format to run RSpec tests on TeamCity? »
We are experimenting with using RSPec for our UI tests and noted that while attempting to integrate these with TeamCity we end up with environment rel...
(1) odpowiedzi
2017-02-06 20:02 Referencing attributes from within a Chef recipe »
I have an attribute file titled default.rb with a key in it default['current'] that stores a dir in string format. I wanted to use this for the follow...
(2) odpowiedzi
2017-02-06 19:02 Rails: best practice to load a helper in controller »
I was hired some days ago to update a Rails 4 app. In general the rspecs and the code look good however in the top of some controller a found this lin...
(1) odpowiedzi
2017-02-06 16:02 Ruby: How to sum array of Time objects? »
I have a CardioExercise model with a duration attribute (Ruby 2.2.4 Time datatype). I need to write a method to calculate the total duration of aerob...
(1) odpowiedzi
2017-02-06 15:02 Regex "punct" character class matches different characters depending on Ruby version »
Ruby's character classes for punctuation characters, i.e. [:punct:], \p{Punct}, or \p{P} seem to match different characters depending on the Ruby vers...
(1) odpowiedzi
2017-02-06 10:02 How to unit test a class that depends heavily on other classes? »
My understanding is that unit testing should test classes in isolation, focusing on granular behavior and substituting objects of other classes usin...
(3) odpowiedzi
2017-02-06 05:02 taking the value of an input already on hostgator.com, and storing it on another page. Set up using Ruby »
I set up a webpage on a hostgator server. There I have an HTML page with a modal with an input for users to add their email. I want to take that em...
(1) odpowiedzi
2017-02-06 02:02 logstash 5.2.0 Unable to find JRuby in Mac »
I'm trying to run logstash 5.2.0 I downloaded the .tar version from https://www.elastic.co/downloads/logstash When I run: logstash-5.2.0/bin/logst...
(0) odpowiedzi
2017-02-05 22:02 Iterating through all files in a given directory »
I am currently using the cities gem to populate a list of cities in the database for creation of addresses. I have been asked to remove this gem and t...
(1) odpowiedzi
2017-02-05 20:02 Update nested_attributes by default »
I try to update iproduction, a nested form from production and I have an error of params with this line : "wrong number of arguments (0 for 1)" @prod...
(1) odpowiedzi
2017-02-05 18:02 Ruby and Rail Application Error when Running Bundle install »
I am following a heroku tutorial where I created my rails app. I was asked to use Heroku to get my app live online. But I have troubled to run the co...
(0) odpowiedzi
2017-02-05 15:02 Rails/SQL: How to order grouped records »
I have a tabel called SessionHistory with the column of ip. I now want to first group the records having the same ip and then sort the groups by the ...
(1) odpowiedzi
2017-02-05 12:02 Have CKeditor use custom model »
I am trying to create a setup where only one table is used for files including ckeditor. As it stands I am using the default with table that is genera...
(1) odpowiedzi
2017-02-05 11:02 Is it possible to make example.herokuapp.com unable to enter unless by certain dns? »
Currently I make a dns that route from my website (example.com) to herokuapp (e.g. example.herokuapp.com). Soon, I will need to add the meta tags and ...
(1) odpowiedzi
2017-02-05 09:02 Initialize model with integer array in Postgres »
I'm using postgres 9.6.1, Rails 4.2.0, and the following migration: class CreateStageBatches < ActiveRecord::Migration def change create_tab...
(1) odpowiedzi
2017-02-05 07:02 not able to run rake db:create in windows to install fedena »
getting error on running cmd in windows Please help me what to do: here is rake # Add your own tasks in files placed in lib/tasks ending in .rake, #...
(1) odpowiedzi
2017-02-05 06:02 Error in Installing RSpec in Rails application - Windows »
While I am trying to install RSpec in my rails application Included rails-rspec 3.5 in gem file While Executing rails generate rspec:install Gettin...
(0) odpowiedzi
2017-02-05 01:02 ruby rails simplecov test coverage not reporting on rake task spec »
I have been battling why simplecov is not reported this rake task as covered when my specs work correctly via pry tests. Can anyone point me in the r...
(1) odpowiedzi
2017-02-05 00:02 Saving multiple objects in rails activerecord »
I have a recurring job with Rails + Heroku scheduler.rake. The problem is that it won't save them successfully when it has too many entries. How c...
(2) odpowiedzi
2017-02-04 23:02 How to get siblings' child according to specific defined sibling content »
I need to find the best method to gather writer and artist information from the following XML data. The comic node appears multiple times and includes...
(2) odpowiedzi
2017-02-04 20:02 Rails add a path from one controller to another controller »
On a checkout controller if the user did not fill in their address he should be redirected to the address path, but after the redirect rails is output...
(1) odpowiedzi
2017-02-04 20:02 Modelling a collection of records that act as as a group »
I'm looking for orientation for either a concrete or abstract approach in Ruby-Like (Rails 4/5) to model the following requirement or user story: Giv...
(1) odpowiedzi
2017-02-04 11:02 Ruby metaprogramming: How can make module method see class's variable »
For example I have a module and a class: module SimpleModule def self.class_hello puts "hello from #{@@name}" end end class SimpleClass @@...
(3) odpowiedzi
2017-02-04 03:02 RSPEC view testing with associated methods »
How do I implement methods provided through an ActiveRecord association using Factory Girl and RSPEC? The code is working as I want it to, but I am un...
(1) odpowiedzi
2017-02-04 01:02 Why is RegExp.escape not working in my Ruby expression? »
I'm using Ruby 2.4. I have some strings that contain characters that have special meaning in regular expression. So to eliminate any possibility of ...
(1) odpowiedzi
2017-02-03 22:02 Ruby on Rails: Glyphicons Not Displaying »
In my RoR application, I am trying to implement the bootsy WYSIWYG text editor. The editor works, but some reason its images are not displaying, i.e. ...
(0) odpowiedzi
2017-02-03 20:02 Rails debug compiled css (SASS) with relative comment path »
I've found at the compiled css assets in my rails application have absolute filesystem paths in the debugging comments. (this is just one example) /*...
(0) odpowiedzi
2017-02-03 20:02 Inline templating does not work along with modularity? »
I'm making a modular application: main.rb require "sinatra/namespace" require "haml" Dir.glob("servers/*/server.rb").each do |server| require_...
(0) odpowiedzi
2017-02-03 18:02 How to conditionally delegate Active Records in Ruby »
Is it possible to delegate a function or series of functions to one of multiple other objects based on conditional logic? Ex: class Item has_one...
(2) odpowiedzi