Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
0 votes
1 answer
73 views

I have the below setup class BudgetLine < ApplicationRecord has_many :budget_line_items accepts_nested_attributes_for :budget_line_items end class BudgetLine::Accommodation < BudgetLine end ...
0 votes
1 answer
68 views

Our Attachment model (in this case used for logos associated to teams) gets saved to the database before we associate it to the team. We do that because we do client side S3 uploading, so we need to ...
1 vote
2 answers
83 views

As a trivial example, let's say I have: class Garage has_many :things accepts_nested_attributes_for :things end class Thing # has a name attribute belongs_to :garage belongs_to :user end ...
0 votes
3 answers
563 views

I have Invoices with many Invoice Line Items. Invoice line items point to a specific item. When creating or updating an Invoice, I'd like to validate that there is not more than 1 invoice line item ...
1 vote
1 answer
403 views

I am getting unpermitted params when I am passing values from UI. The association is many to many between models. class User < ApplicationRecord has_many :user_posts has_many :posts, ...
0 votes
1 answer
114 views

I'm working on a rails CMS project and I am trying to create from the admin dashboard, a quotes section where users can add a section_quote with title, image and five quotes with their authors(5 ...
0 votes
1 answer
367 views

I'm using nested fields and accept nested attributes with a 3 level nested relationship. The 3rd level (I don't think it matters that it's third level) relationship gets deleted when editing the ...
1 vote
2 answers
116 views

I've managed to get nested many-to-many entities created through the use of accepts_nested_attributes_for for the JSON and the project below. My question is - is there a suggested way to achieve the ...
0 votes
0 answers
160 views

I have two models: Article and Paragraph. One Article can include much Paragraphs. Article model: class Article < ApplicationRecord #enum category: {wiki: "Wiki", rules: "Rules&...
1 vote
1 answer
155 views

I want to create a tree structure between two models, Bar and Foo. Bar has many Foos Bar / | \ Foo Foo Foo ¦ Bar / | \ Foo Foo Foo Bar can optionally belong to ...
0 votes
1 answer
234 views

I have a parent model (paper) and a nested child model (tape) and want to create multiple child with a parent in same time without using any gems. The input fields of tape should be dynamically added ...
3 votes
1 answer
1k views

I am trying to update nested records, but for some reason it does not work and my update action is ignored. If I run the following code in console, it returns true, but nothing is actually updated for ...
2 votes
0 answers
120 views

I am trying to create a form that updates 2 tables - commission_type and commission_tier. I created the models, controller and form but when I submit it, my commission_tier table does not update. Only ...
1 vote
0 answers
55 views

I am facing issue in validating nested attributes uniquness. I have 2 models #model : CompanyStore class CompanyStore < ApplicationRecord has_many :company_stores_brands, dependent: :destroy ...
0 votes
0 answers
262 views

My question is an edgecase of how to avoid saving empty records on a nested rails form. I have a simple has_many, where a user can have a maximum of 5 job titles. # user.rb has_many :job_titles ...

15 30 50 per page
1
2 3 4 5

AltStyle によって変換されたページ (->オリジナル) /