Questions tagged as 'ruby'

1
answer

Rails and Iugu: Iugu :: Subscription.create

I'm trying to sign up for a user with my credit card details so I can bill my customers for later. Registration is done in Iugu, but the credit card details are not registered in Iugu. I'm using the calls below. Has anyone done this kind of i...
asked by 12.11.2018 / 15:47
1
answer

What is the best method in Rails to create a self-referenced category?

I would like a tip to create a self-referenced category where it would be possible to add daughter categories of its own and so suspectly for the purpose of building a tree using the same object. Is there a gem or an easy and well-optimized w...
asked by 05.02.2014 / 14:22
1
answer

RAILS File Seed Wheel, but Does Not Save The Data in the Database

I am creating a seeds file to popular my database, this file is responsible for popular Grupos(model :grupo) that runs without problem and also popular TipoAtividade(model :tipo_atividade) , which belongs to the group. > WhenIru...
asked by 22.11.2018 / 10:30
1
answer

Querying records in the bank via date

I'm developing a Ruby sales management system with Rails, and the customer needs to query sales through dates on two calendars, which together make up the range of data he wants to get pulled from the database. The graphical and functional pa...
asked by 25.10.2018 / 19:25
1
answer

Ruby login method

I'm trying to login with Ruby, however it's displaying the error undefined local variable or method 'login' for #<Object:0x00000000059ccea8> (NameError) I've set up the class: class Login <SitePrism::Page element :username_...
asked by 15.11.2018 / 14:12
1
answer

How to make calculations with elements of an array in Ruby? [closed]

numeros = [1, 2] class C def calcule_array(*numeros) puts a + b end end numeros = C.new puts numeros I would like to know how I can do calculations with integers that are inside an array in Ruby, I tried the above c...
asked by 04.11.2018 / 21:31
1
answer

How to import classes from another package

How do I import a class that is in another package Example: "model" package contains the "Car" class, package "execution" contains the "Main" class, from inside the "Main" I want to import the "Car" class, How do I do this? I used require_rel...
asked by 24.09.2018 / 06:50
2
answers

Return the Fibonnaci elements from the last term to the first [duplicate]

I've returned some specific elements already, but I'm trying to get back to the first one. In the code below did I return a certain element, how do I now create from the first, to the fifth, to the tenth? def element( f ) return f...
asked by 16.10.2018 / 03:05
1
answer

Why does not this work?

   .rb: 2: in 'read': No such file or directory @ rb_sysopen -   GameSettings.json (Errno :: ENOENT) I'm trying to make a game in ruby using gosu , and to be able to change the name of the game without having to change all the...
asked by 04.09.2018 / 03:18
1
answer

Error comparing Array in IF

This is my code v3 = [] w=j=k=0 puts "Digite o tamanho do vetor 1" m = gets.to_i v1 = Array.new(m) puts "Digite o tamanho do vetor 2" n = gets.to_i v2 = Array.new(m) for i in 0..m-1 puts "Digite os valores do vetor 1: " v1.push(gets.t...
asked by 25.04.2018 / 04:44