Questions tagged as 'ruby-on-rails'

1
answer

Error Rails Assets. Javascript not working properly (Datepicker)

I want to add the bootstrap-datepicker to my project. I did it this way. Gemfile: source 'https://rails-assets.org' do gem 'font-awesome-sass', '~> 4.5.0' gem 'rails-assets-bootstrap-sass', '~> 3.3.6'...
asked by 08.03.2016 / 15:18
0
answers

Update fields using jquery and gem cocoon

I'm using the cocoon gem of rails for child form creation. When creating the child form, a field called barcode is read and, via ajax, I get the product information and fill in the form fields. This is working correctly, however, when saving, th...
asked by 23.02.2016 / 18:50
2
answers

Saving data in an array in Rails

I need to store data from a database search in an array, but with the code below it only stores a value in the array. @busca= Item.find(:all,:conditions=>{:codigo=>params[:codigo]}) @busca.each do|buscador| @novamatriz=Array.new @novamat...
asked by 22.02.2016 / 14:10
1
answer

Fill an association from another - ruby on rails

I have an application for scheduling services and I'm not able to populate a selectbox from the selection made in another. Explaining better: I have a selectbox with the available services and when I select a service, I want to fill the selectbo...
asked by 21.01.2016 / 13:46
1
answer

Class Person Individuals Individuals. Rails 4

I'm developing a APP in Rails , and the following question came up for the Person class. The structure of these classes looks like this: Pessoa { tipo, status } PessoaJuridica { razãoSocial, nomeFantasia, CNPJ, IE, IM } PessoaF...
asked by 24.02.2016 / 16:47
1
answer

Problem creating devise User + Ruby on Rails

I'm trying to put an entity that already had in my project how to devise to login and etc, I used the following commands add in Gemfile the line gem 'devise' on the terminal I run: rails generate devise:install rails generate devise...
asked by 14.01.2016 / 18:57
1
answer

How to edit simple_form to customize fields

I would like to know how to edit the form fields with simple_form, edit such with the bootstrap, I read some tutorials but I did not understand how I can edit, how to use the class: 'form-control', etc. <%= simple_form_for @admin_category,...
asked by 26.02.2016 / 14:39
2
answers

Validation of has_and_belongs_to_many in Ruby on Rails

I have the following models: class Pedido < ActiveRecord::Base has_and_belongs_to_many :produtos validate :has_one_or_less_produtos private def has_one_or_less_produtos errors.add(:produtos, 'Não é permitido mais de 1 produto'...
asked by 10.12.2015 / 12:03
2
answers

Error when putting puts of a variable within the DEF

Hello. I can not print variable that is inside a def. Script class LogParser def initialize (ip, data, code) log = File.open("/project/log_sec/log/log.txt").each do |file| parse = file.split(" ") data = parse[0] time = parse[1]...
asked by 18.11.2015 / 19:39
0
answers

Google OAuth + Globo.com stopped working

No customer with email @ globo.com is able to access my services via OAuth. In the past they all clicked on "Login with Google", entered the credentials of globo.com, and logged in normally. They are now being redirected to the globomail site, a...
asked by 24.11.2015 / 15:19