Solution to generate table output of data, comments and sugg

I thought I’d make up pseudo rhtml/ruby code I would like to use to
create table views in html.

I basically need flexible helpers to create tables (and later lists). I
do not want to write over and over again the same stuff.

This is what I made up in about an hour. I am still new to RoR.

What do you think about this approach? Which problems do you see
theoretically, practically and implementation wise? Can you suggest
another maybe better approach?

I hope for some feedback.

(jt just stands for jonas tag, i wanted to make sure that i wont take
any actionview method name that might probably be used in future rails
versions like table_tag_start or so)

<% jt_table_begin :for => jt_create_data_from @categories,
:options => { :print_html_comments => false } -%>

<% jt_loop_data -%> <% jt_tr_begin :css_helpers => { :numerate, :first_n_last, :odd_n_even, :id => :primary_key_id } -%> <% jt_loop_data -%> <% jt_th_begin :colums_show => { :name, :status, :updated_on, :created_on }, :colums_orderable => { :name, :updated_on, :created_on }, :css_helpers => { :numerate, :first_n_last, :class => :column_name } ) -%> <% jt_th_end -%> <% jt_td_begin :css_helpers => { :numerate, :first_n_last, :odd_n_even } -%> <% jt_td_end -%> <% jt_tr_end -%> <% jt_table_end -%>

What do you think?

<% jt_loop_data -%> <% jt_loop_data -%>

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs