Questions tagged as 'ruby'

0
answers

I can not install ruby 2.3.2 on CentOS without root privilege

I need to install ruby on a CentOS 6.5 server. I do not have root access, so I can not use yum. I downloaded the source file, unpacked it in a folder called ~/software , and rode ./configure && make && make install How...
asked by 17.11.2016 / 18:46
2
answers

Rename column with Rails using migration

I created a migration to rename a column and I only get the error;    undefined method 'to_sym' for nil: NilClass == 20161001182840 RenameColumnPasswordInUsersPasswordToPasswordDigest: migrating -- rename_...
asked by 01.10.2016 / 20:33
0
answers

Authentication using Token With Devise Rails

Personal needs help to implement token authentication , I have already created the models, the application is working correctly, now I need to improve security. The client will send me a registration and a password, it will come in JSON ,...
asked by 06.09.2016 / 14:28
0
answers

rqrcode_png rails controller - Passing by parameter the string contained in the bank

How do I pass the value that is in the field "codigo" of table "mesas" to the space below "VALOR_STRING_BANCO" ? How do I pass the value that is in the "codigo" field of the "mesas" table to the space below "...
asked by 21.09.2016 / 04:45
0
answers

New fields added after scaffold do not persist in bank even while being strong params

I have a problem here that I have not resolved for 3 days. Very strange. It is in editing a record. It is only updating the first record and not the 2nd onwards. The curious thing is that this only happens with the field quatidade_dev (added aft...
asked by 22.09.2016 / 00:50
1
answer

Relationship Through Many-To-Many ActiveRecord

I have the following configuration in rails: Company has_many :company_products has_many :products, :through => :company_products Product has_many :company_products has_many :companies, :through => :company_products P...
asked by 13.09.2016 / 22:00
3
answers

Display fields from a hash in the view

I have a result of a variable that receives the output of an sql from postgres. I need to iterate in a view and I do not know how to display the given fields. In products_controller I have: def show sql = "SELECT products.cod as cod_pr...
asked by 06.08.2016 / 21:48
0
answers

Create new user in the database via Rails C

Help me where the error is occurring, because I am not able to identify because the field is not being recognized.    rails c u = User.new(email:'[email protected]', registration:192536, password:'changeme', password_confirmation:'changeme') Look...
asked by 06.09.2016 / 21:01
1
answer

When using puts out only the address, not the expected message

Hello, I'm starting with the ruby language and I encounter the following problem that is at the time of starting message through to_s: main class require File.expand_path("lib/Livro") biblioteca = [] instancia = Livro.new "Ruby", "X", "Ca...
asked by 13.07.2016 / 20:27
1
answer

Run ruby script in C

The error code when running in ruby . file.rb: #!/usr/bin/env ruby x=1 while x<10 puts "It Work!" x+=1 end main.c: #include <ruby-2.0.0/ruby.h> int main(int argc, char **argv){ ruby_init(); ruby_script("f...
asked by 15.05.2016 / 22:08