I rails_admin 0.6.5 with Rail 4.1.6 Sequence between the Volume and Points models is being used by has_many / related_to association setup, respectively:
class volume and problem model:
class digits < ActiveRecord :: Base is_to: Quantity, Inverse_of = & gt; : Validates: number, presence: true, numeracy: {big_than_or_equal_to: 1} valid: date, presence: true end rails_admin inside the interface, it works But when creating or editing a problem, the Volume drop-down menu pops up with the Volume # 1 , Volume # 2 , Volume 3 : volume_id according to those "volume numbers", not the volume : number , which is different from the ID and therefore the users are confusing.
How do I control when a problem is created or edited, which volume column is displayed in the is_to association drop-down menu? Thank you in advance for the support provided.
. An array is RailsAdmin.config.label_methods that have these properties in order of preference.
By default, they [: name ,: title]
I want to add: display_name to the front of the list so that I can easily override any model which is on DB There is a name column.
To do this, add the following line to After that, in your model: config / initializers / rails_admin.rb
config.label_methods.unshift (: display_name) )
the volume of the class
Comments
Post a Comment