[Nitro] table

Emmanuel Piperakis epiperak at softlab.ece.ntua.gr
Tue Sep 6 22:44:15 EDT 2005

Hi all,
my latest question ;-)

After poking around on how to use the TableMixin I found out the 
1) the example in the file table.rb is wrong (deprecated). In order to use 
the TableMixin you have to do the following
a) create a header array
b) create a values array of array by mapping your data to that array
c) call the mixin

# in the controller
def bgroups
   @data = Bgroup.all.map {|b| [b.title_en,b.title_jp,b.creation]}
   @header = ['title_en','title_jp','creation']
   @id = 'bgroup_id' # same as in the css file, used for formating

# in the view file
     #{table(:id => @id, :headers => @header, :values => @data)}

2) My question is: when I want to Localize the headers then the following 
line does not work (even thought it should)

@header = ['[[bgroup_title_en]]','[[bgroup_title_jp]]','[[bgroup_creation]]']

it seems that the TableMixin returns the string for the table creation, 
but the string does not get Localized.


Emmanouil Piperakis (epiperak at cs.ntua.gr)
{To explore is Human, to Create is Devine,
  To teach is Primal, to Rule is Sin}

More information about the Nitro-general mailing list