1,643 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
1
answer
88
views
Idiomatic Rails way to select records with checkboxes in a big form to choose whether to save or not
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, ...
-3
votes
1
answer
124
views
Rails Devise Strong Parameters not building Nested Association
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 ...
0
votes
2
answers
95
views
Get a sum value from nested attributes, in Python
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 ...
0
votes
0
answers
49
views
"Rails: NoMethodError for Nested Attributes in Form Submission
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 ...
0
votes
1
answer
73
views
Defining translations for nested forms in namespaced resources
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
2
answers
170
views
How can I select elements based on an attribute of a child of a parent element's previous sibling?
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 ...
0
votes
0
answers
45
views
Rails unable to update multiple nested attributes at once?
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: :...
1
vote
1
answer
47
views
Unpermitted Parameter error in Rails for nested nested form submission
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 ...
1
vote
0
answers
55
views
Keep nested attribute's values to show validation errors on form submit
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 :...
0
votes
1
answer
118
views
Unpermitted Params using Polymorphic Association in Rails 7
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
...
1
vote
2
answers
117
views
Rails form for not creating unique ids
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, ...
3
votes
1
answer
352
views
How to automatically assign parent ID as foreign key when using nested attributes?
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 ...
0
votes
1
answer
74
views
Displaying information from unrelated nested models
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 ...
0
votes
1
answer
3k
views
Ransack, unable to search two attributes
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 ...
0
votes
0
answers
34
views
Rails flexible checklists
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 ...