active_scaffold :mail_template do |config|
config.list.columns = [:name, :language_id, :autocall_traitment_type]
config.list.sorting = {:language_id => 'ASC'}
config.list.sorting = {:autocall_traitment_type => 'ASC'}
config.list.sorting = {:name => 'ASC'}
config.show.columns = [:name, :subject, :language_id, :autocall_traitment_type, :body]
config.update.columns = [:name, :subject, :language_id, :autocall_traitment_type, :body]
config.create.columns = [:name, :subject, :language_id, :autocall_traitment_type, :body]
# Other config options would be here
config.columns[:language_id].label = "Language"
config.columns[:language_id].form_ui = :select
config.columns[:language_id].options = Language.find(:all).map {|l| [l.name, l.id]}
With this code, i have name of language in my screen:
How to resolve this?
Looks like the 'Mail Templates' section is showing
language_id
instead of thelanguage.name
.Add a helper method to the MailTemplate model.
Then change your scaffold list.columns
language_id
tolanguage_name
.