Data dodania Pytanie
2017-10-01 15:10 Computing ActiveRecord nil attributes »
In my Rails app I have something like this in one of the models def self.calc columns_to_sum = "sum(price_before + price_after) as price" where('...
(2) odpowiedzi
2017-10-01 12:10 Scraping and storing in CSV in Ruby »
I am a Ruby-newbie and I tried my first scrapper today. It's a scrapper designed to store recipes in a CSV file. Nevertheless, I can't figure out why ...
(3) odpowiedzi
2017-10-01 10:10 Parse index.html with Nokogiri and assign a.link with the following text »
Please help me to figure out how to properly assign Build name with date and then sort out all link in ascending order by upload date. Example of Ind...
(2) odpowiedzi
2017-10-01 10:10 Rails : how to use Jruby instead of the native Ruby on MacOs »
I am trying to use Jruby in mac. I see that there is Ruby already installed in usr/bin I like to use my custom jruby rather than the default ruby ins...
(0) odpowiedzi
2017-10-01 04:10 Rails 4.2.1: Cannot create record »
today I tried creating a new model like usual I created my controller first: rails g controller Newsletters Then I created my model: rails g model...
(1) odpowiedzi
2017-10-01 00:10 I18n configuration under config/application.rb is ignored »
I am trying to setup Internationalization in my app. I have setup config/application.rb as follows: class Application < Rails::Application ...
(1) odpowiedzi
2017-09-30 21:09 Why am I getting a RunTimeError in my tests and the opposite boolean than expected? »
What I don't understand is why not_stormy.stormy? is equating to true!! As you can probably tell I'm almost completely new to both Ruby and Rspec. An...
(2) odpowiedzi
2017-09-30 16:09 'deploy:link_shared_paths' causes invalid symlinks when deploying Rails 4 app with mina »
I have a Rails 4 app that is running on two identical servers. I am using mina and when I run mina deploy SERVER="ip address" it works just fine. ...
(0) odpowiedzi
2017-09-30 09:09 Anyone can explain rails utility classes or share link in which anyone exlpain rails utility classes in detail »
I want to use utility classes in rails.But in rails guide i did not find description about rails utility classes. I don't know how we use in rails. Ho...
(0) odpowiedzi
2017-09-30 08:09 What is 'valid?' in RSpec? Where can I look at it? »
I've attempted to create a model, which needs to pass a series of validation tests in RSpec. However, I constantly get the error expected #<Survey...
(1) odpowiedzi
2017-09-30 08:09 redirection of signup failed in devise gem »
I have customized the device gem and place the login and signup form on same page /users/sign_in. When sign up failed then user get redirect to /users...
(0) odpowiedzi
2017-09-30 07:09 Rspec can't reproduce failures not even with minimal reproduction commands from bisect »
We use Travis CI to maintain our project on git. The issue here is on Travis we have 2 processes running a random selection of specs each with differe...
(1) odpowiedzi
2017-09-30 02:09 Rails, edit action does not populate the form correctly with many instances of the same model »
I'm new to Rails and I'm doing my first project. Also english is not my native language so bear with me please. The problem I'm having is that I have...
(3) odpowiedzi
2017-09-30 02:09 Ruby: Averaging values of Array of Arrays while Grouping according to Date »
How to average values of the second element of an array of arrays; instead of adding them : [ [ '01-01-2001', 4 ], [ '01-01-2001', 5 ], [ '01-01-2001...
(1) odpowiedzi
2017-09-29 20:09 for-loop or while-loop doesn't work on third and fourth iteration »
I'm working on a Ruby assignment that tasks you with building a small, test-driven program that translates some words and phrases into pig latin. Fir...
(1) odpowiedzi
2017-09-29 18:09 Why are these outputs different? »
These two have different output. aArray = [[1,2],[2,3],[3,4]] aArray.each {|subArray| puts subArray} aArray.each {|subArray| puts "#{subArray}"} ...
(4) odpowiedzi
2017-09-29 16:09 Random Images in Ruby on rails 4 App »
I am using this code to display random images for similar products in the same category the selected product is in. <div class="row container pro...
(1) odpowiedzi
2017-09-29 16:09 Creating a full path to sub-directory on a server »
I am currently working on a Rails application and recently received a request to add the ability to go to a sub-directory on the server at work. i.e....
(1) odpowiedzi
2017-09-29 14:09 Rails where query chain with or for array input »
I want to create a query chain in order to find my bot users given specific filters. Some filters can have multiple values. For example, my "locale" f...
(2) odpowiedzi
2017-09-29 02:09 Run rake assets:precompile before tests that include :js tag and skip otherwise »
tl;dr -- Is it possible to run a single command (e.g. rake assets:precompile ) only when there is a :js test included in the body of tests being run?...
(1) odpowiedzi
2017-09-29 01:09 Details on executing Ruby code using Sinatra »
I have a Ruby script : require 'uri' require 'net/http' require 'openssl' require 'json' require 'pp' require 'opal' require 'ostruct' url = URI("M...
(1) odpowiedzi
2017-09-28 23:09 Send email to only certain Users, Rails 5 »
I'm having trouble sending an email blast to only certain users who have a boolean set to true and to not send the email to those users who have it se...
(1) odpowiedzi
2017-09-28 21:09 Sort an array of array by 2 conditions »
I have to sort this ary = [[5, "e", "2"], [2, "r", "="], [2, "y", "2"], [2, "h", "="]] to obtain : # => [[5, "e", "2"], [2, "y", "2"], [2, "h"...
(2) odpowiedzi
2017-09-28 19:09 Rails 4 app is not writing to production.log , running on Nginx, ubuntu and deployed via capistrano »
My app is breaking when customer place an order. I'm really getting desperate since I need my production.log to figure out what is breaking the app!...
(1) odpowiedzi
2017-09-28 18:09 I can't access to my sinatra webapp url using docker and passenger »
I have to learn how to use docker, and how to dockerize a sinatra webapp. I've followed this tutorial : http://coding.jandavid.de/2016/01/22/dockeriz...
(0) odpowiedzi
2017-09-28 17:09 TypeError: superclass mismatch for class Task »
I have a Rails project and use RSpec for testing. Recently, I added this in my spec_helper.rb: config.before(:suite) do Rails.application.load_task...
(1) odpowiedzi
2017-09-28 16:09 Ruby Undefined method error - Using Beaker »
I'm quite new to all of this. I am trying to test out a puppet module using Beaker. I keep getting this: NoMethodError: undefined method `descri...
(0) odpowiedzi
2017-09-28 16:09 JRuby: Not found despite being installed and linked »
Not sure whats up with this issue... Warning: jruby 9.1.13.0 is already installed, it's just not linked. You can use brew link jruby to link this v...
(0) odpowiedzi
2017-09-28 15:09 errors replacing development.sqlite3 with another development.sqlite3 on rails »
I am trying out an example from a book head first rails, i get to chapter 2 and i have issues following the instructions maybe because they used an ol...
(0) odpowiedzi
2017-09-28 05:09 has_one association creates multiple records in rails »
I have a User model and Shop model. I want to allow user to create only one shop. So in my User model class User < ApplicationRecord # Include d...
(1) odpowiedzi
2017-09-27 23:09 Concerns vs Services »
Recently I was building a complex logic controller and wanted to refactor it due to “Single responsibility” principle. So I read about Services. B...
(2) odpowiedzi
2017-09-27 22:09 Creating array from dynamic formatted date keys »
I'm trying to create a hash that uses the year-month as a key. Consider this code: (start_date..end_date).map { |date| date.strftime('%Y-%m') }.uniq...
(1) odpowiedzi
2017-09-27 20:09 Best way to perform error handling using modules in Rails? »
I'm pretty new to Rails and back-end API developement so excuse me if I misuse a concept or so. Right now I'm attempting to refactor a large amount of...
(1) odpowiedzi
2017-09-27 16:09 How to convert arabic digits to numeric in ruby »
Params include arabic digits also which I want to convert it into digits:- "lexus/yr_٢٠٠١_٢٠٠٦" I tried this one params[:query].tr!('٠١
(1) odpowiedzi
2017-09-27 15:09 Where is spec_helper.rb file located? »
I was trying to run the tests using rspec spec.rb But it is giving me following warning: Deprecation Warnings: Requiring `rspec/autorun` when runni...
(0) odpowiedzi