How to place the label for virtual columns.
class City < ActiveRecord::Base
belongs_to :nation
end
class User < ActiveRecord::Base
belongs_to :city
def nation
self.city.nation.name if self.city
end
end
class Admin::UsersController < ApplicationController
active_scaffold :user do |config|
config.columns = [:name, :description]
# Translation to Spanish
columns[:name].label = "Nombre"
columns[:city].label = "Ciudad"
columns[:nation].label = "Pais" # <--- The error occurred
while evaluating nil.label=
end
end
Thanks for any help.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---