Questions tagged as 'ruby'

1
answer

Statistic in Ruby on Rails

I have the following problem, I need my system to generate some statistical data from a vector, for example: vetor = [1, 5, 2, 1, 6, 30, 2, 7, 2, 80] I need to extract some data from it, like: Medium Medium Fashion Minimum...
asked by 07.08.2014 / 13:43
3
answers

Many to Many JSON POST - Rails 5 - Only API

Hello, I'm developing an Engine in Rails 5 where it will be just a blog API. It will be a simple system. Post has several Passions and Passions has several Posts. I made the N < - > The problem is that when sending the JSON of the post...
asked by 29.03.2017 / 13:28
1
answer

What Ruby applications do you have besides the web?

I want to delve into Ruby, for the ease of language, as well as Python, which for example, in my University use a lot for mathematical and scientific applications. I see a lot of the use of Ruby with Rails for Web, but I would like to know if...
asked by 23.04.2016 / 18:11
1
answer

Check if a value is present in an array in Ruby

How to check if a certain value is contained in an array in Ruby? For example, I want to know if 'A' is present in the ['A','B','C'] vector.     
asked by 11.02.2015 / 22:57
1
answer

Migration to Heroku

I am migrating the DB from my app to Heroku , deploy worked: $ git push heroku master When trying to migrate the database according to the command $ heroku run rake db:migrate does not work and returns the followi...
asked by 25.02.2015 / 17:35
1
answer

UTF-8: reading and inserting into MySQL via Ruby 1.8

I'm using a Ruby script that parses an XML file and inserts the information into a MySQL database. It works perfectly fine, but it's giving me a headache now that my XML files have strings in Portuguese Detail: I'm completely new to Ruby....
asked by 02.07.2014 / 21:22
1
answer

UML Questions for System in Rails

My question is the following. Rails controllers for basic CRUD operations require several methods that are repeated throughout the application's controllers. I'm drawing the diagrams for a CBT application that has several CRUD's, and so I'm find...
asked by 07.07.2014 / 01:00
1
answer

strong_parameters in Rails using datetime

I am using strong_parameters to create a nested form object in a form . All my attributes work correctly, except those defined in datetime . Is there anything special about receiving datetime nested? Looking at th...
asked by 31.03.2014 / 17:22
1
answer

Adding Time converting to seconds in Ruby

I'm trying to find the average difference between the creation date and the last update of the records in a table as follows: tickets = Ticket.all.where('updated_at IS NOT NULL') t = tickets.sum(:updated_at, conditions: 'updated_at.to_time') -...
asked by 11.03.2015 / 15:24
1
answer

Error: incompatible character encodings: UTF-8 and ASCII-8BIT

Incompatible character encodings: UTF-8 and ASCII-8BIT . {"utf8"=>"✓", "authenticity_token"=>"3cl0R8ghLDvPMGkh0I+LCrzQjmyu1donLE9y58rIT1k=", "post"=>{"title"=>"Somos apaixonados por música!", "caption"=>"Estamos entrando n...
asked by 04.06.2014 / 15:58