You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's say you have a form for @project and want to provide a form to add/edit multiple tasks at once.
f.inputs for: :tasks do |t|
t.input :name
end
This renders all available tasks in @project. However, if you want to limit the tasks by a collection you are building (to create) or fetching (to update), – e.g. a collection of tasks you have selected previously to mass-edit – you don't have a "formtastic-native" option to define the collection.
DSL I am talking about:
f.inputs for: :tasks, collection: @my_tasks_collection do |t|
t.input :name
end
Would that be in the proper sense of @justinfrench / formtastic? If yes, I'd go for that feature. Or is there already a solution to this (which I just haven't found)?
The text was updated successfully, but these errors were encountered:
f.semantic_fields_for :tasks, @some_tasks works for me (just passing the collection as a second argument). This mirrors the built-in fields_for. Not sure if there is currently a way to do the same thing with inputs.
@pduersteler The API you've proposed sounds pretty good. AS @Grantovich pointed out, there is a work-around. Would love to see a pull-request for your improvements.
Let's say you have a form for
@project
and want to provide a form to add/edit multiple tasks at once.This renders all available
tasks
in@project
. However, if you want to limit the tasks by a collection you are building (to create) or fetching (to update), – e.g. a collection of tasks you have selected previously to mass-edit – you don't have a "formtastic-native" option to define the collection.DSL I am talking about:
Would that be in the proper sense of @justinfrench / formtastic? If yes, I'd go for that feature. Or is there already a solution to this (which I just haven't found)?
The text was updated successfully, but these errors were encountered: