Questions tagged as 'ruby'

1
answer

Docker Pull Error

When I try to download an image from docker, like the official image of 'ruby' or any other image, it gives this error: ✘ user@debian  ~  sudo docker pull ruby [sudo] password for user: Using default tag: latest Error response from daemon:...
asked by 28.02.2017 / 21:04
1
answer

Problems running the rails server with vagrant

I created a Xenial Xerus 64x box with the vagrant, installed the rvm with rails. I'm running the server on the quiet VM, I can access the VM rails running there, but I can not access from my local browser. I had already used vagrant other...
asked by 19.01.2017 / 19:11
1
answer

Bcrypt - Automating password encryption process

Hello. I already have a column in my bank called password. Use devise for authentication, so it created another column called encypted_password. Even if I copy all the password values and play to encrypted_password, I would have to face an error...
asked by 04.01.2017 / 19:13
1
answer

How to do a data migration routine?

Suppose I have one registration model and one user model. How do I get each registration record sent to the users? This should also be done with each new record that is created in the registry, it must be migrated to the user model. I'm new t...
asked by 28.12.2016 / 19:31
1
answer

Ruby on Rails, how to improve the performance of the Hash transformation for ActiveRecord?

Personally I have a performance problem when transforming a hash to the activerecord model objects, the hash is returned by the gem savon after consuming a web service. The benckmark has a relatively high time for the hash size that is 0.25sec f...
asked by 23.12.2016 / 23:18
1
answer

NoMethodError: undefined method 'send_data' for CloneDatabase: Class

Rails does not find method send_data clone_database.rb require 'zip' class CloneDatabase < ApplicationController def self.make_clone zip_data = 'a'.to_json send_data zip_data, type: 'application/zip', filename: 'Topic...
asked by 12.12.2016 / 18:03
1
answer

How to redirect to the same position of the object after the update

I'm displaying a collection of random objects in my action index. However, the objects are displayed one at a time. So: @objects = Object.order("RANDOM()").limit(1) In the view index, I can send a comment to this object, but when I submit t...
asked by 06.12.2016 / 23:10
1
answer

Load constant

I'm having trouble for instance the Report model. Console: LoadError (Unable to autoload constant Report_questao, expected app/models/report.rb to define it): app/controllers/pessoas_controller.rb:49:in 'reportar' controller: require...
asked by 21.11.2016 / 10:30
0
answers

Catch the value of a select_tag and put in a variable

I want to get the value of this select_tag and put it in the link_to message <%= select_tag(:testee, options_for_select(CloneDatabaseController.find_all_models)) %> <%= link_to('Click here', controller: 'clone_database', action: 'sho...
asked by 13.12.2016 / 20:45
1
answer

Largest palindrome product - Ruby

How to make this code faster? It works, but not fast enough. #!/bin/ruby def isPalin(mul) if mul.to_s == mul.to_s.reverse then return true else return false end end def lp(n) arr = [] for a1 in (100..999) for a2 in (10...
asked by 20.10.2016 / 19:04