All Questions
3 questions
2
votes
0
answers
550
views
How to dynamically set 'name' attribute of a simple form input
I am using Simple Form in a Rails application in which a FormsController controller was defined as follow :
class FormsController < ApplicationController
def index
@forms = Form.all
end
...
1
vote
1
answer
400
views
Forms and Strong Parameters Identification Hash
I defined the following strong params and new method in a controller named FormsController. Use case is that the user can create one form which includes several fields.
class FormsController < ...
5
votes
4
answers
11k
views
How to permit hash with * key => values?
I want to create an object with strong params that can accept dynamic hash keys.
This is my code,
Quiz.create(quiz_params)
def quiz_params
params.require(:quiz).permit(:user_id, :percent, :grade, ...