Questions tagged as 'ruby-on-rails'

0
answers

rubymine proxy error

I tried to install a gem in rubymine and I got the following error:    ERROR: Could not find a valid gem 'rails' (> = 0), here is why:    Unable to download data from https rubygems.org/ - no such name ( link ) Then I set the...
asked by 10.08.2016 / 18:19
1
answer

Error using a nested resource 'undefined method' new 'for nil: NilClass'

I'm trying to make a nested resource work but I got stuck; I get an error trying to create a new 'prescription', please if someone can help me identify what is happening I would appreciate it. Greetings! Error:     undefined method 'new'...
asked by 17.08.2016 / 19:30
0
answers

Form nested resources

I'm trying to make a form by adding a variable related to the table, it would be a product that has a product and a product that belongs to a product, I followed this tutorial: link and I am also implementing the ajax application through this...
asked by 18.07.2016 / 20:13
2
answers

text_field of rails 4 separated by comma and store it in the database

I have the following models in rails payment_supplier.rb class PaymentSupplier < ActiveRecord::Base has_many :folio_has_payment_suppliers has_many :folios, through: :folio_has_payment_suppliers, dependent: :destroy end folio_has_paymen...
asked by 06.08.2016 / 18:45
1
answer

Show nested in show of the parent model

I have 2 models I have a father and another son, I can create the child form without problems within the father. <h3>Agregar Programa</h3> <%= link_to_add_association 'Agregar', f, :lists, 'data-association-insertion-node' =&...
asked by 14.09.2016 / 17:30
2
answers

How do I get the data of a query join in ruby on rails

I have this query @permiso = Permiso.joins(:importador).joins(:producto) Now I need to get the data in variables to be able to work with them Currently I get them this way, I need to know what is the right way to do it. <% @permiso....
asked by 09.10.2018 / 19:55
2
answers

In Ruby on Rails how to insert several records at once with ActiveRecord

I want to do this as if I were doing it in mysql INSERT INTO ratings ('id','app_id','user_id','created_at','updated_at','unique','valoracion','valoracions_id') values (1,2,3,"2017-04-07","2017-04-07",12,4.8,1), (1,2,3,"2017-04-0...
asked by 07.04.2017 / 17:18
2
answers

How to export some fields with their records to a new postgres table

If I had a table with n fields and m records and I want to create a new table with some fields and all the records, understanding that there are fields that image images among other formats, how can I import those records and fields in the most...
asked by 30.10.2017 / 18:03
1
answer

How to return an object with an ids arrangement in a ruby on rails has_and_belongs_to_many

I hope you can help me, I have the following models class Family < ApplicationRecord has_and_belongs_to_many :categories end class Category < ApplicationRecord has_and_belongs_to_many :families end and I need to return an object...
asked by 06.04.2018 / 19:56
2
answers

Load options from a table in Ruby on Rails

I have 2 tables with their respective model and controller. One is productos and other marca . I did a scaffold for both. In the product form I put a select with the idea of loading the options based on the data in the ta...
asked by 10.03.2017 / 21:57