Questions tagged as 'ruby-on-rails'

2
answers

Rails + Materialize Select field

Diplomats, I have the following problem: <div class="input-field"> <%= f.label :kind_id %> <%= collection_select(:contact, :kind_id, @kind_options_for_select, :id, :description, class: 'input-field') %> </div&g...
asked by 09.03.2017 / 14:48
2
answers

Counter in model

I'm looking for a way to add a variable with increment to add to the id of a div, could anyone tell me the most recommended way to do this? My difficulty in making this increment is due to cocoon that is used to call this render <%= li...
asked by 09.12.2016 / 14:27
2
answers

Where is my error in this Ruby code?

I'm having trouble with methods with parameter passing, the code runs, but it buga when I step to var within one method and receive as parameter in another. I'm new to Ruby. def player_welcome puts "Seja bem vindo ao Jogo de Adivinhação !!...
asked by 14.10.2016 / 01:47
1
answer

Application based on multiple authorization profiles [closed]

I have a handful of doubts in an interesting scenario, I hope you can give me a little help. I'm using the ng-token-auth package for authentication, for permissions control the package angular-permission , my Rails backend is configured wi...
asked by 14.10.2016 / 13:44
1
answer

Query in ActiveRecord

I have this relationship . How do I query on ActiveRecord to return data for Works , WorkZei and Wi_schools ? I've tried it like this: r = Responsible.find(1) students = r.students students.each {|s| s.scho...
asked by 04.05.2016 / 22:57
1
answer

How to upload file via ajax with Rails 4?

I want to download a pdf file to process on my controller and then return it as it gets rendered in the backend , I would like a loading bar or circle to appear. However, I'm having trouble sending the file asynchronously. How do I send an asyn...
asked by 02.08.2016 / 06:03
2
answers

How to register a new Person when creating a new Customer

I have a question that has already been broken for a while, next, I have a Person model, which is the generic person and the Customer model, which belongs to Person, like this: class Person < ActiveRecord::Base has_one :customer has_on...
asked by 02.08.2016 / 01:42
2
answers

error giving the command rake db: create in rails summer 4.0.0

Well, I'm starting in Ruby on rails, I'd like to understand the following error when generating the rake db:create so I can fix it. /home/jefferson/.rvm/gems/ruby-2.2.3@catalo/gems/activesupport-4.0.0/lib/active_support/values/time_zone.rb:2...
asked by 29.10.2015 / 00:54
1
answer

Change date format in rails form

I know there is a way to edit the location, to move it to the Brazilian format. But I do not know the syntax for changing the format in the form: <div class="field"> <p> Garantia </p> <%= f.date_select :guarantee...
asked by 22.07.2015 / 21:32
1
answer

Problem in Ruby on Rails 3.2 - It shows in Git's HTML commands

When I push the server (I'm using jenkis and gitlab) when I check the address it shows several errors. www.scti.uenf.br this is the site that has a problem. Ruby 1.8.2 Rails 3.2 Jenkins Gitlab Problem Scree...
asked by 25.07.2015 / 22:37