Questions tagged as 'ruby'

1
answer

See records from the same month

I'm having difficulty searching the sqlite3 database, records for a specific month, I searched the internet but found nothing that could help me. I have an account template that has belongs_to with the class Location that is an enum where it has...
asked by 25.07.2017 / 22:14
1
answer

Passing Date by Ruby on Rails parameter

I'm trying to pass a date clicked as a parameter in order to load another view and I can not do it. The idea is to list all bookings made on the selected day. Controller class ReservasController < ApplicationController ... def search...
asked by 03.08.2017 / 03:11
1
answer

Error "bash: ruby: command not found"

I'm trying to install Ruby on Rails on Windows, but I install and whenever I try to use Git BASH in the "Sites" folder that is created in the installation, this error appears. How can I fix it? Command that I try to run: ruby -v     
asked by 17.07.2017 / 22:41
1
answer

Metaprogramming with ruby, methods with SELF

Good evening ... I come from other languages somewhat different to Ruby, like C / C ++, JAVA ... And I missed a little while trying to understand the difference of the following methods: Class teste def novo "1" end def...
asked by 13.06.2017 / 04:26
1
answer

Error in RoR: undefined method '[]' for nil: NilClass - NoMethodError in Site :: Home # index

This application was made using the following Bootstrap template: link In my case, after I made all the changes and adaptations, correctly doing the ASSETS and PRE-COMPILE'S, the application ran perfectly on my machine (locally / developmen...
asked by 18.07.2017 / 23:51
2
answers

Null return of an object in the controller - RAILS

Hello! I have the following code snippet from a controller called ProductsController: def index @produtos = Produto.all end def gerarlog @produtos.each do |produto| File.open('produtosBD.yml', 'a') do |arquivo| arq...
asked by 30.05.2017 / 21:01
1
answer

Ruby and PHP in the same VPS [closed]

I am considering the idea of hiring a VPS in Linode to host different projects. The issue is that some of them are in PHP and others in Rails. My question is: Is it possible to configure a VPS to run both technologies? Would you recommend...
asked by 11.04.2017 / 22:21
1
answer

CSV In Ruby - Doubt

Good afternoon guys, I'm having a hard time understanding how Ruby works with csv, I need to read a file and import the data from that file into a variable I have a file named die.txt so Id | Nome | Endereco 1 | Renato | Alameda das magnol...
asked by 09.02.2017 / 16:41
1
answer

Use existing data in the database for authentication

I have a database with already existing data, with name, CPF, RG and other personal data. I need to implement a login system, but I wanted the user to be in the case the registration number and the password the CPF, for example. In the login sta...
asked by 20.12.2016 / 16:23
2
answers

How to send form_tag variables to javascript function? Rails

I'm new to web programming and rails and I have the following question: I have a view that displays a list of foods and a field to fill with the amount of grams I want from each food. I would like to display a text_field_tag for each e...
asked by 27.11.2016 / 06:23