When using simpleform, how can I order selection options using associations? I have something like this:
= f.association :color
You can pass the collection parameter to the association:
collection
= f.association :color, collection: Color.order('created_at ASC')
Source: https://habr.com/ru/post/1434508/More articles:How to determine Mac OS X version in JavaScript - javascriptWhy do we want to apply the ClassInterface attribute to a class? - c #JQuery Delete row on dynamic tables - jqueryHow to scroll a list by dragging an item up or down? - listviewHow to restrict sed to replace only data appearing after the first closing square bracket? - sedAre HTTP requests with HttpClient too slow? - androidchange tablet orientation using jquery and modernizr - jqueryGet the number of nonzero elements in a numpy array? - pythonProblem with Python garbage collector? - pythonproblems importing a scanner class - javaAll Articles