Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
82 views

I’m building a Rails app related to golf. Users can search for golf courses via an API, and the results are rendered as individual forms per course. Right now, each course must be saved individually, ...
Alessandro Chuy's user avatar
-3 votes
1 answer
124 views

I did generated devise controllers and views and defined both User and Account models like the following: User class User < ApplicationRecord # Include default devise modules. Others available ...
Michael K Madison's user avatar
0 votes
2 answers
84 views

I need to code a SEARCH class, so that accessing its attributes by their nested representation(s). Attributes and their relationship: the goal of the 'SEARCH' class is to obtain a serie of consecutive ...
hornetbzz's user avatar
  • 9,405
0 votes
0 answers
49 views

Description: I'm working on a Rails application where I have a Picture model that has a nested Pictureclass model. The index (the gallery of pictures) and the show (a detail of the picture) are ...
coopeu's user avatar
  • 93
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 ...
Magnus Remøe's user avatar
0 votes
2 answers
165 views

Is there way I can hide the 2nd and 3rd anchor elements inside the li elements using CSS? Also, it needs to be hidden based on the attribute selector "isInternalUser=true" which is there in ...
Sanju R's user avatar
  • 11
0 votes
0 answers
44 views

I have a deeply nested attributes controller, like this: def update @product = Product.find(params[:id]) authorize @product if @product.update(product_params) render status: :...
Msencenb's user avatar
  • 5,104
1 vote
1 answer
44 views

I'm trying to create a quiz builder where a user builds a quiz that is added to the Quiz model, a question that is in the QuizQuestions model and answer choices in and AnswerChoices model. The Quiz is ...
auto's user avatar
  • 1,163
1 vote
0 answers
55 views

I have a model Parent class Parent < ApplicationRecord has_many :jobs accepts_nested_attributes_for :jobs, allow_destroy: true end and model Job class Job < ApplicationRecord belongs_to :...
Imanpal Singh's user avatar
0 votes
1 answer
116 views

Based on image above, I do a simple example. Model: Person class Person < ApplicationRecord belongs_to :personable, polymorphic: true end Model: Customer class Customer < ApplicationRecord ...
Saulinho's user avatar
1 vote
2 answers
114 views

This is driving me crazy. I have 2 models, StockShipment has_many Recipients. It also has: accepts_nested_attributes_for :recipients, reject_if: :all_blank, allow_destroy: true I have this partial, ...
user3074558's user avatar
3 votes
1 answer
349 views

An action creates records based on multiple layers of nested attributes, upon the submission of a form. However, the ID of the root record, which I call .save on, is not propagating downwards to the ...
Raphael Müller's user avatar
0 votes
1 answer
74 views

I'm building a Rails application with two models, both with a further two nested models: Contacts -> Trackers -> Emails and Goals -> Stages -> Templates I want to display information from ...
Cat Morley's user avatar
0 votes
1 answer
3k views

I'm a beginner trying to make a searchbar, i'm with a simple attribute research, works fine, but when i try to add another attribute in the search_field, i have an error : "Ransack needs Product ...
samuel bellotlecoq's user avatar
0 votes
0 answers
33 views

I need advice if my approach is right I would like to create a digital checklist for several test types with the possibility that users can add further questions to the checklist at any time. I have ...
Christian Schumacher's user avatar
3 votes
1 answer
232 views

I have a rails API that injects primary key IDs from the client, as opposed to autogenerating through Rails. Specifically: class ParentModel < ApplicationRecord accepts_nested_attributes_for: ...
PlankTon's user avatar
  • 12.6k
2 votes
1 answer
1k views

I have a problem translating nested attributes on laravel validation, the code im using is like: $this->validate($request,[ 'title.*' => 'required' ]); and * can be: en, es, fa ... and other ...
Kowalski's user avatar
0 votes
1 answer
149 views

Im new to ruby on rails so i need some tips please. Im trying to render some checkboxes on the edit view for a user. I have tried to follow the documentation for the nested_attributes but the ...
Webie's user avatar
  • 33
0 votes
1 answer
30 views

This is the document from where i wanted to pull data from { "_id" : ObjectId("635cbfee36945e4a79b0af70"), "EID" : 200, "EName" : "...
Radhey Yadav's user avatar
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, ...
Aniket Tiwari's user avatar
1 vote
0 answers
109 views

I'm working on a form object where I build and save an instance of Service, but I'm having a hard time building and saving nested records. A Service has_one features_set and ...
pinkfloyd90's user avatar
-2 votes
3 answers
302 views

I have an object is data like this : Original data const data = { "title": "sunny", "members": [ { "fullname": "rozo", "customers": [ { &...
Zoro123's user avatar
3 votes
3 answers
2k views

My program contains a lot of configuration parameters so I was looking for a way to have them all in one place, accessible from every file in the project. I thought about a config module which would ...
Wippo's user avatar
  • 963
0 votes
0 answers
63 views

I have product, feature, product_feature, and quota. # product.rb has_many :product_features, dependent: :destroy has_many :quotas, through: :product_features has_many :features, through: :...
Matthew Berman's user avatar
0 votes
1 answer
66 views

I am trying to update the value of an item codenumber field every time the user selects an item from a list using jquery. My view is like this. <tr class="nested-fields"> <td ...
kouroubel's user avatar
  • 280
0 votes
1 answer
406 views

I'm facing this issue and after digging, I can't seem to find a solution for this. I'm trying to create a user and his meet_infos on a nested form, but in the params, I always end up with "...
Amine BEN TALEB's user avatar
1 vote
1 answer
204 views

I'm trying to copy the values from Model A nested attributes to Model B nested attributes. The nested fields are the same in their respective tables. Just the parents are different. I pass the model A ...
Chrismisballs's user avatar
0 votes
0 answers
34 views

I'd like a User to be able to create an Event and associated Invitations. An Invitation is a join table between User and Event (with an enum for its state, default to pending). Eligible users are ...
Sumak's user avatar
  • 1,081
1 vote
2 answers
113 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 ...
foamroll's user avatar
  • 813
1 vote
1 answer
1k views

I'm trying to get specific data based on next array condition in Go. I think, I will just give an example to make it clear. Let's say I have an array like this detail: { contacts: [ { ...
Aethereal's user avatar
  • 183
0 votes
0 answers
157 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&...
omni395's user avatar
  • 19
0 votes
0 answers
286 views

I have 2 associated models and am trying to create the child from the parent's controller: class Purchase < ActiveRecord::Base has_many :comments, as: :commentable, dependent: :destroy ...
Jeremy Thomas's user avatar
0 votes
0 answers
22 views

I have application with form containing Parents with its Child rendered through Nested Attributes in view for edit. Take example of Hr trying to edit an employee details along with his skill ratings. ...
Arun Yadav's user avatar
1 vote
0 answers
105 views

I'm making an app where users can create and edit Surveys with a number of Questions. Instead of an Answer class, I am serializing the possible answers for each Question as an array in a column named ...
Stack Overflown's user avatar
0 votes
1 answer
494 views

I have a parent model 'page' and nested attributes model 'page_modules' which at same time are modeled by 'Single Table Inheritance' pattern. My problem is when I try to save different generated '...
Sahu's user avatar
  • 183
0 votes
1 answer
976 views

I'm attempting to build a form with multiple nested objects in a has_many :through relationship. However, the nested objects do not appear to be getting assigned the foreign_key of the parent object ...
Tony Beninate's user avatar
0 votes
1 answer
427 views

Im building an API in which i have a model called Studio. Studio has many movies and many series, and movies and series have many characters of their own. Also, a character can be in many movies and/...
GuidoMedina's user avatar
0 votes
1 answer
182 views

I have some model with accepts_nested_attributes_for class SomeModel < ApplicationRecord has_many :some_resources accepts_nested_attributes_for :some_resources, allow_destroy: true ......
infernal's user avatar
0 votes
1 answer
531 views

I have been trying to get a simple test example of a nested form in Rails 6 running but so far I have not been able to create an example that works. As far as I know I created a correct association in ...
Aloalo's user avatar
  • 167
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 ...
Ankita Agrawal's user avatar
0 votes
0 answers
116 views

I am trying to implement a structural analysis class and I getting the following error. The idea is to assign a CrossSection object to a Beam object and assign the value of Beam.eleTag attribute (...
MarcoPellegrino's user avatar
0 votes
0 answers
52 views

What the buildpack should i add for the link_to_add_association to make it work in heroku? for some reason the gem cocoon works locally but not working in heroku Someone mention to add buildpack to my ...
nourza's user avatar
  • 2,331
0 votes
0 answers
130 views

I did alot of research to make this work. but nothing solved mine link_to_add_association not working in heroku gem "cocoon" <%= form_for(resource, as: resource_name, url: ...
nourza's user avatar
  • 2,331
0 votes
1 answer
2k views

his is the first time I am using cocoon gem so I am not sure how to use it properly,I am not getting error but the link_to_add_association is not working." link_to_remove_association" gives &...
mamadgi aishwarya's user avatar
0 votes
0 answers
44 views

I want to insert into two database tables by clicking on a button. And there are several problems: First Problem: Models: class Dish < ApplicationRecord
 has_many :courses
 has_many :days, ...
ADV's user avatar
  • 97
-1 votes
1 answer
399 views

I have a question about Rails Nested Attributes. I'm using Rails 4 and have this model: model Location has_one parking_photo has_many cod_photos accepts_nested_attributes_for :parking_photo ...
Kyle's user avatar
  • 33
0 votes
2 answers
62 views

I have a system where admins can create Exams and price them according to the Branch they are selling them in. So for example, Exam One can cost $5 in Branch One, but $10 in Branch Two. I made a join ...
sbstnssndn's user avatar
-1 votes
1 answer
119 views

I have a simple_form_for that creates an invoice. Through this form, I want the user to be able to create a client that will be associated with that before-mentionned invoice. The current process ...
Narf's user avatar
  • 33
0 votes
1 answer
107 views

I have an Exam and an ExamBattery that is just a collection of Exams. They have a has_and_belong_to_many declaration for each other, and ExamBattery accepts nested attributes for Exam, like so: class ...
sbstnssndn's user avatar
1 vote
3 answers
579 views

I have models: Product, Parts and ProductParts product.rb class Product < ApplicationRecord has_many :product_parts has_many :parts, through: :product_parts accepts_nested_attributes_for :...
Lukasz's user avatar
  • 217

1
2 3 4 5
33