Skip to main content

All Questions

Filter by
Sorted by
Tagged with
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 ...
ogs's user avatar
  • 1,229
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 < ...
ogs's user avatar
  • 1,229
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, ...
Eric Chu's user avatar
  • 1,679