More dry views?

Posted by Pravin on Stack Overflow See other posts from Stack Overflow or by Pravin
Published on 2011-03-05T06:55:16Z Indexed on 2011/03/05 7:24 UTC
Read the original article Hit count: 156

I have a simple index page for clients. Client has 20 fields. I am displaying list of clients in a table. For this I have to write in my views something like:

- @clients.each do |client|
  %tr
   %td=client.name
   %td=client.email
   %td=client.address
   %td=client.phone etc...

I am just curious if I can do it something like

- @clients.each do |client|
  - client do
      %tr
       %td= name
       %td= email
       %td= address
       %td= phone etc...

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby-on-rails-3