I would suggest using the custom label label method for this. The RailsAdmin configuration might look like this:
config.model Merchandise do
object_label_method
:custom_label
end
end
And your ActiveRecord model will contain a method for instance labels:
class Merchandise < ActieRecord::Base
def custom_label
"#{self.label} #{self.another_column} #{self.another_column2}"
end
end
This does not answer your question about available binding variables, but I hope it addresses the root question. If you want to see which variables are available in a custom field view, you can view the views in ~ / rails_admin / app / views / rails_admin / main /. A quick grep shows that [: object] bindings are available in these views, but IIRC, there are several other binding variables that are available.
source
share