Data dodania Pytanie
2017-02-12 22:02 'undefined method `>' for nil:NilClass in ruby »
This is my code for converting a user entered string into a Caesar cipher. puts "text?" text = gets.chomp puts "key?" key = gets.chomp.to_i plain...
(1) odpowiedzi
2017-02-12 08:02 rails – AJAX Search, Sort, Paginate with Ransack and Kaminari »
I have been following this tutorial https://techbrownbags.wordpress.com/2014/01/17/rails-ajax-search-sort-paginate-with-ransack-kaminari/ and it work...
(0) odpowiedzi
2017-02-12 04:02 What's the difference between a setter method and a virtual method (in Ruby)? »
I'm studying Ruby and trying to wrap my head around some vocabulary. Somewhere I picked up the notion that a setter notion is also a virtual method, i...
(3) odpowiedzi
2017-02-12 00:02 How can I cast an object to string for use with ActiveRecord queries? »
I have a User, which has a String email attribute. However, when I'm dealing with an email in my app, I find it desirable to first convert it to a (no...
(2) odpowiedzi
2017-02-11 17:02 Gem install not finding existing gem »
When running gem install I get the following: gregoryostermayr@gregors test $ gem install jruby-boilerpipe ERROR: Could not find a valid gem 'jruby...
(1) odpowiedzi
2017-02-11 14:02 RSpec: Force error within negated custom matcher »
I have a custom matcher, that has an expect within: RSpec::Matchers.define :have_access_to do |action| match do |user| allow(controller).to rec...
(1) odpowiedzi
2017-02-11 14:02 ::Rails::Engine - No route found »
I'm using ruby 2.4 and rails 5. I'm trying to write my first gem and setup an engine to mount some basic controller logic. I have the following as...
(0) odpowiedzi
2017-02-11 05:02 How to express the variable in absolute value form »
'This is the variable which I want to express in absolute value . <%= rate-32.5 =%> However ,I tried <%= |rate-32.5 |=%> It doe...
(4) odpowiedzi
2017-02-11 04:02 How to find number of records based on association through join table »
I have User, Assignment, and Account models. Users can belong to many accounts and accounts have many assignments. As an admin on an account you can '...
(2) odpowiedzi
2017-02-11 01:02 Bundler::GemRequireError: There was an error while trying to load the gem 'omniauth-oauth2' »
I have a bizzare error and i do not seem to find any way to fix it. Basically my heroku deployment fails with that message. More: Removing bourbon (...
(2) odpowiedzi
2017-02-11 01:02 Monit and private_pub »
to start the thin server with monit is just start program = "/etc/init.d/thin start" but to start private_pub or faye is needed to bundle the rackup....
(1) odpowiedzi
2017-02-11 00:02 Create an array containing values oscillating between two boundaries »
I am wondering if there is a way to generate an array which, for example, would start from 0, increase by 1 until it reaches 3, and then decreases by ...
(3) odpowiedzi
2017-02-11 00:02 How can I use JSON data with Ruby? »
This seems really simple but I've looked all over and I can't find any documentation for this. I have the following json file: //data.json { "movi...
(1) odpowiedzi
2017-02-10 21:02 Rails 3 to 4 migration uniqueness validation issues »
Context We are migrating from Rails 3.2.12 to 4.0.2 and Ruby 1.9.3 to 2.1.8. We have a lot of test coverage to accomplish the migration in the form ...
(0) odpowiedzi
2017-02-10 21:02 React JS: no answer from Sinatra server with fetch call »
I am quite new to Sinatra and React JS, therefore I just wanted to make an GET call from my React website on a Sinatra server to display a plain text....
(1) odpowiedzi
2017-02-10 20:02 Shortcut for conditional variable manipulation in Ruby/Rails »
One of the parameters my API controller receives has a big key name and I need to convert it from string to integer, if it is present, before sending ...
(1) odpowiedzi
2017-02-10 20:02 How to pass command object to method? »
I have a Command table which look like this in rails console Command(id: integer, created_at: datetime, updated_at: datetime, timeout: int...
(2) odpowiedzi
2017-02-10 16:02 How to write standalone scripts in ruby and call them in rake tasks and what is a standalone scripts »
I want to write standalone script in ruby on rails and want to call it in rake task. I have seen lot of post about standalone scripts but nothing seem...
(1) odpowiedzi
2017-02-10 14:02 Rails - how to incorporate 'quantity' bookings using counter_cache and update correctly »
I'm building an events app using Rails and have added a counter_cache association between my Event and Booking models in order to capture the number o...
(1) odpowiedzi
2017-02-10 04:02 Adding to Ruby Objects »
I have been doing a little reading up on Ruby. Like how simplistic the language is. I've been trying to look it up, and figure it out on my own. I'm l...
(2) odpowiedzi
2017-02-10 03:02 How do I write an RSpec test that confirms Password Reset Token has been Saved to the DB? »
I'm writing a test for my Rails 5 API to confirm a password_reset_token is generated whenever a user requests a password reset. I have a short passw...
(1) odpowiedzi
2017-02-10 01:02 gem install libv8 -v '5.3.332.38.1' ... Error installing libv8: ERROR: Failed to build gem native extension »
Any ideas/suggestions? **** Further update:**** 2.3.1 agxxx-xxxight 2290-fix-claim-button % ruby -e 'puts Gem::Platform.local' x86_64-darwin-13 I h...
(1) odpowiedzi
2017-02-09 23:02 Use RSpec to test for DeserializationError »
I have a job that is enqueued. Sometimes, the record associated with that job is destroyed before the job is ran. To resolve any ActiveJob::Deseriali...
(0) odpowiedzi
2017-02-09 23:02 Ruby on Rails - Adding data to model from Javascript »
I'm trying to implement a tag/category system using tag-it, but I'm unsure the best method I should be using to pass the data back to the model. Curr...
(0) odpowiedzi
2017-02-09 22:02 How do I split a string on non-traditional white-space? »
Ruby 2.4. I want to split a line by multiple white spaces, that is more than one single breaking or non-breaking space, or white space that is not a ...
(1) odpowiedzi
2017-02-09 16:02 Sinatra Static Page »
In my public folder, I have a file index.html. I want to be able to just use the url localhost:4567 to display the page (without displaying localhost:...
(2) odpowiedzi
2017-02-09 15:02 Ruby, understanding local variables scope in if block »
I have detected an unexpected behaviour in a variable declaration into an if block: puts "local_variables: #{local_variables}" puts "defined? my_vari...
(2) odpowiedzi
2017-02-09 15:02 Delete other user except current_user in rails app using devise gem »
I am trying to list all the users who are using my application and delete only those that i want. But every time when i try to delete my user it passe...
(3) odpowiedzi
2017-02-09 14:02 Rails - counter_cache not working »
I'm building an events app using Rails and have added a counter_cache association between my Event and Booking models in order to capture the number o...
(1) odpowiedzi
2017-02-09 14:02 Http testing my ruby based API »
I'm trying to test my ruby API, but I m facing some difficulties to send the right data format. I can easily create a desired data format from rspec c...
(1) odpowiedzi
2017-02-09 02:02 How to represent the SQL value NULL in ActiveRecord#create calls? »
Since seeds.rb is in Ruby, I'm guessing that if I want the effect of insert into foo values (hoo: "ioo", koo: null); I should do something like Fo...
(2) odpowiedzi
2017-02-08 23:02 Build up help for TDD/BDD with RSpec »
For about 2 weeks ago i've started learning Ruby, i've made an WebParser / Page WordCounter using 'open-uri' and 'nokogiri'. So i just run up the term...
(1) odpowiedzi
2017-02-08 20:02 Zlib::GzipFile::Error: not in gzip format »
I'm trying to decode a gzipped string with zlib and jruby. Here is the minimal working example. require 'stringio' require 'zlib' str = 'H4sIAAAAAAA...
(1) odpowiedzi
2017-02-08 18:02 Can a Ruby method accept either a block OR an argument? »
I'm doing the lessons on The Odin Project and now I have to write myself a new #count method (with another name) that behaves like the normal one from...
(3) odpowiedzi
2017-02-08 17:02 RSpec cannot find route for nested resource »
I'm dealing with a seemingly strange issue while trying to run unit tests on a nested resources controller. Here's my setup: routes.rb: Rails.applic...
(1) odpowiedzi