Posts by gmadeira • 141 points
11 posts
-
1
votes0
answers342
viewsQ: Angular2 Update variables between components
I’m starting at the angular 2 and would like to know the best way to do the following: I have 2 Components, Toolbar.Component and profile.Component. When the user updates the name of the logo and…
-
1
votes0
answers69
viewsQ: New fields added after scaffold do not persist in the bank even though they are in Strong params
I have a little problem here that I haven’t been able to solve for 3 days. Very strange. It’s in the editing of a record. He’s just updating the first record, not the second. The curious thing is…
-
0
votes0
answers878
viewsQ: Jquery find next element inside a complex div
Friends, I need to find an element in a tree DOM a little complex and I’m not getting the result. As I leave the input id = "barcode" i add new lines below and need to trigger the click on the next…
-
1
votes3
answers295
viewsQ: 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 it in a view and I don’t know how to display the specified fields. In products_controller I have:…
-
0
votes1
answer47
viewsQ: Multiple Joins with Active record returning null
Friends, I have the following exits from the console (Rails 4.1): Product.all Product Load (0.2ms) SELECT "products".* FROM "products" => #<ActiveRecord::Relation [#<Product id: 4, cod:…
-
1
votes1
answer142
viewsQ: How to join 4 tables in SQL that is returning empty ? (Inner, Outer or left Join )
I have 4 tables with the following relationships: Products has N Variations Sizes has N Variations Colors has N Variations Variations belongs to Products,Sizes and Colors The structure of the tables…
-
2
votes1
answer120
viewsQ: Rails 4 Error each_with_index when using activerecord-import
I’m trying to import an app into Rails 4 using Gem activerecord-import. When I try to execute the command: Detail.import( columns, values, :validate => false ,:timestamps => false ) I get a…
-
0
votes1
answer170
viewsQ: Update stock before saving template with nested_attributes and Gem Cocoon
Friends, I have a form that uses nested_attributes and I use Gem Cocoon. I have 3 models involved. Variation Containing Stock, Order, Containing Order and Parent of Detail Containing Order Detail.…
-
2
votes3
answers390
viewsA: Calculate parent and child totals
Personal problem solved. The models got like this: class Order < ActiveRecord::Base has_many :details, dependent: :destroy belongs_to :customer accepts_nested_attributes_for :details, :reject_if…
-
5
votes3
answers390
viewsQ: Calculate parent and child totals
Friends have 2 templates. Orders have several Details. I use Cocoon to create forms. The order model has a total that is the sum of the child model totals. What I would like to know is what is the…
-
0
votes0
answers196
viewsQ: Update fields using jquery and Gem Cocoon
I’m using the Rails Cocoon for child form creation. When creating the child form, a field called Barcode is read and, via ajax, I receive the product information and fill in the form fields. This is…