Questions tagged as 'ruby'

2
answers

Error starting "Rails Server"

Hello, I'm trying to install Ruby on Rails on Ubuntu and start the server using the rails server I get the following error. felipe@Dumont:~/mo$ rails server /home/felipe/.rvm/gems/ruby-2.0.0-p481/gems/execjs-2.1.0/lib/execjs/runtimes.rb:5...
asked by 05.06.2014 / 04:27
1
answer

Why use Kernel # loop instead of begin-end-while / until?

I'm doing a repeat structure in Ruby using the following structure: begin [código] end <while/until> [condição] But RuboCop , which I use as a linting tool, says that I should use Kernel#loop with break . So: loop...
asked by 03.12.2017 / 15:52
1
answer

Ruby - Printing zero as decimal place

I am learning to program in Ruby, and to go training, I use Uri Online Judge, where I solve exercises that are presented, I make the code in some language that the platform accepts (in this case Ruby) and then I send it to the system , but the o...
asked by 02.05.2017 / 01:15
1
answer

Access level and hierarchy when marking a checkboxes

Talk, people, beauty? Can you help me with something? I'll explain: I log in with the admin user and it shows all permissions on the system. As an example, suppose you have 10 (index, show, create, update, user delete and profile). Out of the...
asked by 03.10.2016 / 15:35
1
answer

Bank Account Validation Rules [closed]

Where do I get the official bank account validation rules and check digit? After a lot of Google search, I can only find rules ten years ago and in forums, with no source reference. I learned that Itaú has undergone changes in its rules and I...
asked by 20.10.2016 / 15:18
2
answers

Nested attributes with rails

I am developing a system for studying, which will allow the creation of a user. This user, in turn, will have an inventory, which will have several items. My question is how to save all these resources at once when accessing the action new...
asked by 17.05.2016 / 20:27
1
answer

Handle .txt file in Ruby and BD pupular?

I need to open a .txt file that has a sequence of strings separated by ";" and I need to put every ";" in a vector to later create a loop and insert into the bank. What I have: require 'pg' require 'active_record' = File.open('teste.txt'...
asked by 23.08.2016 / 18:17
1
answer

How to compare dates coming from a CSV file in Ruby

Good personal I have a CSV file with some data in it in case this: Nome; Data; Salario JOANNA 1981-04-11 7519.07 LUCIMAR 1958-06-10 819.77 PEDRO 1976-05-11 83.43 JOAO 1989-03-12 867.5 CAIO 1954-02-13 88.6 JULIANA 1958...
asked by 04.07.2015 / 05:31
1
answer

What files should be inserted in .gitignore in a Rails project?

I'm starting in Git and also in Ruby on Rails. I created a new project using rails new myapp -d mysql and added it to my GitHub repository. When creating the project rails generates several files. So far so good, but it turns out that...
asked by 26.05.2015 / 16:03
2
answers

How to add more fields to the user table with gem Devise

I would like to know if there is any possibility of adding more fields to the user table generated by Devise because I need to relate it to others, and add more information. Is there any problem in doing so?     
asked by 02.04.2015 / 21:06