Data dodania Pytanie
2017-03-16 23:03 How to run rails commands in production with capistrano 3 and rvm installed »
I'm struggling to get a decent understanding of capistrano. I want to run rails commands in production but it seems that the corresponding binstub is ...
(1) odpowiedzi
2017-03-16 21:03 Your user account isn't allowed to install to the system RubyGems »
I am running the command bundle install in a project folder. In some project folders it will produce an error and in other projects folders it will...
(1) odpowiedzi
2017-03-16 17:03 Single or Multiple logger instance in a web project »
I'm work on build a log system in my project, which is a Ruby Web App base on Sinatra, similar with Rails. I've referenced a lot of logging framework...
(1) odpowiedzi
2017-03-16 16:03 Rails 3 switching to strong parameters ForbiddenAttributesProtection error not raised? »
I'm attempting to add strong parameters to a Rails 3 application, but it is still permitting all mass attribute assignment and doesn't raise an error ...
(0) odpowiedzi
2017-03-16 15:03 Rspec - access describe name in describe context, not in `it` »
I have such simplifyed rspec code: require 'rspec' describe 'DescribeTitle' do describe_name = self.class.description p describe_name it 'shou...
(1) odpowiedzi
2017-03-16 12:03 Replace until all occurences are removed »
I have the following strings: ",||||||||||||||" ",|||||a|||||,|" I would like to achieve that all occurrences of ",|" are replaced with ",," The o...
(4) odpowiedzi
2017-03-16 11:03 How to find all regex matches with match-all parts? »
This is my text: hello foo-1 hello bar $4 hello ... I need to find everything that matches /hello .*/: ["hello foo-1", "hello bar $4", ...] What...
(2) odpowiedzi
2017-03-16 10:03 How do you run a basic sinatra app on cloud 9 »
I am using cloud 9 IDE to follow this tutorial. How can I run Sinatra on Cloud 9 ? I created a blank workspace in cloud 9, ran gem install from comman...
(1) odpowiedzi
2017-03-15 22:03 Rails Query Active Record By Pairs OR'ed »
I have an API that looks like... get(not_unique_id:, pairs: []) ...where pairs can look like [{ foo: 1, bar: 'a' }, { foo: 2, bar: 'b' }] and I wan...
(1) odpowiedzi
2017-03-15 22:03 How to stop Event Machine in setup like this? »
I have a Sinatra app, overall configured like described here sinatra docs. It basically starts an event machine loop. Now, If I want to write a RSpe...
(1) odpowiedzi
2017-03-15 21:03 How to include gems in java implementation using jRuby? »
I have written a demo program to run ruby code in java(basically scala, but it's quite similar) using jRuby. Here is what I am doing: package com.fl...
(0) odpowiedzi
2017-03-15 19:03 Writing a regexp as argument to gsub! method -- stumped? »
In my Rails 4.2.6 / Ruby 2.2.4 app, I have a db query method that generates a string; for example: "Chest - pectoralis, Quads - quadriceps, Hamstring...
(4) odpowiedzi
2017-03-15 19:03 How to fix aborting Fibonacci sequence code »
I am trying to get a Fibonacci sequence of 5 million elements. This code aborts abnormally, when I pass 1000 as a parameter. def self.fibo_seq(limi...
(4) odpowiedzi
2017-03-15 19:03 Rails form preview page »
I want to save the Job data in the database, and redirect to a preview page (instead of the show page) which displays all the information from the Job...
(2) odpowiedzi
2017-03-15 14:03 Trying to write a Java wrapper which will start or stop logstash »
I have written a java wrapper which I am using to run logstash. I want, if my parent thread dies all the ruby threads should get killed. Currently, Ex...
(0) odpowiedzi
2017-03-15 13:03 Rails add new and edit form in bootstrap modal »
I'm new with Ruby on Rails. Now I'm trying to make a simple ToDo List app with bootstrap. Everything works but I tried to render my New task form to...
(2) odpowiedzi
2017-03-15 09:03 How to DRY up associations in includes? »
I have a scope method in which i'm using includes to eager load all the necessary associations. But i'm not sure how to DRY up the associations used i...
(2) odpowiedzi
2017-03-14 23:03 RSpec test not hitting view with render_view »
I am getting this error when using RSpec to test an index action and response in a Rails controller: JSON::ParserError: A JSON text must at...
(1) odpowiedzi
2017-03-14 22:03 Override gem method in rails »
I want to let users add interests -TV shows in this case-, and to make sure they type a correct tv show, I'm going to search imdb first and let them s...
(2) odpowiedzi
2017-03-14 15:03 Rails How to retrieve act-as-taggable-on tags on multiple levels of associations »
Summary I have acts_as_taggable_on :skills in my Ad.rb Model. I have the following relationships: Host Model has_many :locations Location has_many...
(1) odpowiedzi
2017-03-14 08:03 Quirk when parent's class method accesses the subclass's constants »
Given the following code: class Parent CONSTANT = "Parent" def self.do_the_thing puts CONSTANT puts self::CONSTANT end end class Chil...
(2) odpowiedzi
2017-03-14 08:03 Can I manipulate the current iteration of the collection being currently iterated over? »
Say I have a collection of @lines, and I want to iterate over it, but I want to manipulate how it is iterated over based on the contents of the collec...
(5) odpowiedzi
2017-03-14 04:03 Rails 3: Get helper_url from path »
I am trying to get the helper_url from the current path. For example if I have the following route: get "user/:user_id" => 'user#user_info', :as =...
(1) odpowiedzi
2017-03-14 02:03 calling instance method on model and passing its parameters »
I have model.rb class Foo def baz(param1, param2, param3, param4) puts 'something' end end controller.rb def signup param4 = params[:par...
(2) odpowiedzi
2017-03-14 00:03 Ruby Sinatra textarea displays variable string instead of variable value »
I'm trying to set up a webapp using Sinatra, and I've got it working currently where the user can enter a list of URLs into a textarea, click submit, ...
(0) odpowiedzi
2017-03-13 23:03 ActiveRecord::StatementInvalid in Devise::RegistrationsController#create »
I'm trying to add some extra information to my Devise User model like first_name, last_name, age, gender and city. When I fill the signup form and cl...
(2) odpowiedzi
2017-03-13 17:03 ActiveRecord log which query went to which database »
In an ActiveRecord application with multiple connections to different databases, nothing in the log indicates which query went to which database. The...
(3) odpowiedzi
2017-03-13 10:03 Rails .where() query not working »
Thanks a lot for your help. I have a locations and ads table. Location has_many :ads I perform the following query on Location Model. @locations = Lo...
(1) odpowiedzi
2017-03-13 09:03 RSpec request spec test always returning empty response »
I'm currently putting together a project on Rails (4.1.8) and am trying out writing RSpec request specs to test the api routes. Strangely however it a...
(1) odpowiedzi
2017-03-13 09:03 How to convert an active record with associations to a nested hash? »
SO... I am writing some code that will query an active record with associations and return the data in a format similar to... [{ foo: { ...
(3) odpowiedzi
2017-03-13 02:03 Ruby + Sequel + Sinatra + MySQL connection issues »
Hi have a simple web app built in ruby, sinatra and sequel connected to a mysql DB. Im using Ubuntu 14.04.3 LTS ruby 2.0.0 gem 'sinatra', '1.4.5' gem...
(1) odpowiedzi
2017-03-12 23:03 ruby rails rspec rake does not swallow message output »
My spec provides coverage like I had hoped, however, the following 2 messages are displaying in the rspec output: rake resque:scheduler rake environm...
(1) odpowiedzi
2017-03-12 23:03 ruby rails rspec rake resque task spies »
While simple coverage is reporting this as 100% covered I am not satisfied. The spec marked as focus I would like to confirm that all of the Resque m...
(1) odpowiedzi
2017-03-12 17:03 Skipping to next vowel and consonant in a string »
I completed an assignment that has the following instructions: Pseudocode and write a method that takes a spy's real name (e.g., "Felicia Torres")...
(4) odpowiedzi
2017-03-12 13:03 Rails .joins() between tables and .where() condition »
Summary Thanks a lot for your help. I have a locations and ads table. Location has_many :ads I would like to make a query of Location Model with a j...
(2) odpowiedzi