Questions tagged as 'ruby'

1
answer

Determine what to print using wicked_pdf on ruby on rails

I have a view of the data of a person (contact data, address, work data, medical data, etc.). At the moment I can convert everything I have in the PDF into PDF, but what I need is that when I press the button to convert to PDF I will see a scree...
asked by 25.10.2016 / 13:34
0
answers

rubymine proxy error

I tried to install a gem in rubymine and I got the following error:    ERROR: Could not find a valid gem 'rails' (> = 0), here is why:    Unable to download data from https rubygems.org/ - no such name ( link ) Then I set the...
asked by 10.08.2016 / 18:19
2
answers

How do I get the data of a query join in ruby on rails

I have this query @permiso = Permiso.joins(:importador).joins(:producto) Now I need to get the data in variables to be able to work with them Currently I get them this way, I need to know what is the right way to do it. <% @permiso....
asked by 09.10.2018 / 19:55
1
answer

see what directory I am in (PWD) in ruby

I am learning ruby, so I am doing several programs that I had already done in python to practice the language (because I can not think of many things I can do, if someone comes up with a ruby programming exercise please write in the comments.) A...
asked by 10.07.2018 / 05:41
1
answer

How to return an object with an ids arrangement in a ruby on rails has_and_belongs_to_many

I hope you can help me, I have the following models class Family < ApplicationRecord has_and_belongs_to_many :categories end class Category < ApplicationRecord has_and_belongs_to_many :families end and I need to return an object...
asked by 06.04.2018 / 19:56
2
answers

Load options from a table in Ruby on Rails

I have 2 tables with their respective model and controller. One is productos and other marca . I did a scaffold for both. In the product form I put a select with the idea of loading the options based on the data in the ta...
asked by 10.03.2017 / 21:57
1
answer

When I do ruby htmlImg.rb https://example.com/index.html I get

When I run my script with: $ ruby htmlImg.rb https://ejemplo.com/index.html I get this error: /usr/share/ruby/2.3.0/net/http.rb:479:in 'get_response': undefined method 'hostname' for "https://twitter.com/Yojiexo":String (NoMethodError)...
asked by 06.11.2017 / 23:46
1
answer

doubt how to do this exercise [closed]

I have an exercise in logic but I have not been able to understand how to do it I have a txt file with the answer question format and a line break where it follows that same format: 1-question answer - jump line - 2-question an...
asked by 05.09.2017 / 00:12
1
answer

question yes or no in ruby [closed]

I'm doing a mini game in ruby I want to make that when the person answers yes, he flies to run the game Ahem: print "¿Desea volver a jugar si o no: " respuesta = gets.chomp How do I do it so that when I answer yes, the game is repeated?...
asked by 11.07.2017 / 20:41