Skip to content

Let's add a sortable option for the has_many formbuilder #880

@michaek

Description

@michaek

This would add a jQuery UI sortable to the items in a has_many, with the :sortable parameter accepting the field the sortable should update. That field would need to be included in the fields for the associated model - for example:

f.has_many :images, :sortable => :sort do |i|
  i.input :image
  i.input :sort, :as => :hidden
end

The feature will only update the value of the hidden field, which would only be persisted to the database upon submitting the form.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions