Questions tagged as 'ruby'

0
answers

How to call a method in the view that returns a pdf to the user?

I created a small script to consume my API, in Ruby. require 'http' data = response = HTTP.get("http://localhost:9292/api/boleto", :params => {:type => 'pdf', :bank => 'blabla', :data=> '{...}'}) puts response.body # retorna um...
asked by 06.04.2018 / 16:20
0
answers

String insert in Ruby for JS

How can I make the code below in Ruby for JS. (3...value_size).step(3) { |num| value.insert(value_size - num, separator) } For step I think of this loop for (var i = 3; i < value_size; i += 3) , but for the .insert...
asked by 20.03.2018 / 02:33
0
answers

rails 5.1 simple form

I am trying to put a mask on my simple form initially, I tried it as follows :input_html => {:maxlength => 14, :"data-mask" => "999.999.999-99"} It did not work so I tried :data => {:mask=> '999-999-9999'} That also di...
asked by 07.03.2018 / 20:44
0
answers

Ruby - MSYS2 Update

I'm starting in Ruby in Windows environment and am having the following problem installing RubyInstaller during the development kit installation process. :: Starting core system upgrade... atenção: terminate other MSYS2 prog...
asked by 20.02.2018 / 04:43
0
answers

How do I get the name of a variable?

Is there any way to get the name of a variable using metaprogramming (or reflection, I believe it's a synonym) in Ruby? I want something like nameof for C #. I was looking for something like: minha_variavel = "valor" minha_variavel...
asked by 13.02.2018 / 21:48
0
answers

Map Hash in Ruby

I am loading a hash of an .yml file in the following format: { 'user_id' => 'id', 'profile' => { 'about_me' => 'about', 'phone' => { 'mobile' => 'mobile_phone', 'home' => 'home_phone' }}} I want to output another hash with...
asked by 11.02.2018 / 18:04
0
answers

"ruby_executable_hooks" error on Atom

Good morning. I installed the autocomplete-ruby package in my Atom text editor, and also installed the rsense gem that the package requires to work. But after you close and open Atom, it displays the following error message:    autocomplet...
asked by 09.02.2018 / 13:07
0
answers

Problems with animation

There is an animation in the game that the character attacking with the sword, ah sword and an image behind the character, the code draws so. but my real problem is with Index, when the player goes through a type of portal to go to another map,...
asked by 04.02.2018 / 13:41
1
answer

Ruby on rails routes

I'm starting in Ruby on Rails and I had a problem with nested routes : class Maquina < ApplicationRecord has_many :verificacaos accepts_nested_attributes_for :verificacaos end class Verificacao < ApplicationRec...
asked by 23.01.2018 / 19:46
1
answer

NoMethodError: undefined method 'empty?' for #URI :: HTTPS: 0x000000063069d8

I'm doing a REST request but when I run I get this error: NoMethodError: undefined method 'empty?' for #<URI::HTTPS:0x000000063069d8> My code: require 'net/http' require 'uri' def mandareq url = URI("https://gateway.plusmms...
asked by 15.01.2018 / 13:23