Questions tagged as 'ruby'

1
answer

Create a ruby on rails feature list

I have been trying for a few days but I have not been able to solve my problem. I need to create a feature list for an item and then list all of them. I wish they could help me or pass me some tutorial on. Home Well I have a person's registry an...
asked by 29.04.2017 / 18:45
1
answer

Problem to select a specific object within a hash

Hello! Good Morning. I have the following situation: In my Ruby code, there is a flower class (attributes: code (generated by a function with auto increment), name , and category (this attribute also represents the hash key)). Each inst...
asked by 20.03.2017 / 15:02
0
answers

Automation of tests with selenium cucumber and capybara

I'm starting to learn how to use a means for automating testing in web applications. However, I came across a problem that I can not solve and found nowhere (questions or documentation) that would explain a method that would solve my problem....
asked by 18.09.2016 / 06:17
1
answer

Rails 4 Error each_with_index when using activerecord-import

I'm trying to import an app into Rails 4, using the gem activerecord-import . When I try to run the command: Detail.import( columns, values, :validate => false ,:timestamps => false ) I get an error like this: **NoMethodEr...
asked by 01.06.2016 / 18:10
1
answer

How to make a multidimensional array read data entered by the user?

F1=[['1','2','3'],['4','5','6'],['7','8','9']] print "\nJogador 1: Escolha uma linha e uma coluna no tabuleiro:\n" L=gets.chomp C=gets.chomp F1[L][C]='X' The idea here is to build a game of old.     
asked by 30.04.2016 / 22:30
1
answer

Nested Attributes Rails child model not saved

Good afternoon! I'm having a problem storing templates with nested attributes . In the app we have Customer , which has 1..n Contacts , which in turn has 1..n Telephones . I researched a lot before putting it here and decided to onl...
asked by 30.03.2016 / 20:10
1
answer

Could not find gem byebug (= 0) in Ruby on Rails

When I run the command rails server , the following message appears:    Could not find gem byebug (> = 0) This is in Windows. I tried to use gem install byebug but it does not work and in Linux it has the following message...
asked by 21.11.2015 / 12:11
1
answer

Query using "select" and "joins" with activerecord in Rails 4

I need to make a report and I have the following query : Deducao.joins(:prestador) .select('pessoas.razao_social, pessoas.qtd_min_mensal, count(deducoes.id)') .group('deducoes.prestador_id') .having('count(ded...
asked by 01.07.2015 / 20:52
0
answers

Subdomain accessing only specific resources with Rails

I'm using Rails 4.2.2 I have the following code in the config / routes.rb file: Rails.application.routes.draw do namespace :api, constraints: { subdomain: 'api' }, path: '/' do resources :users end root "pages#home"...
asked by 23.06.2015 / 16:16
1
answer

Summing a value in a field with rails

Hello! In my users table I have a downloads field. I would like that when the user enters the page I add +1 in that user field. What is the best way to do this? Do I really need to do 2 querys? get the current value and then add anothe...
asked by 19.08.2014 / 14:23