How can I transform this haml into a table?

Posted by mmr on Stack Overflow See other posts from Stack Overflow or by mmr
Published on 2010-05-20T03:11:16Z Indexed on 2010/05/21 7:10 UTC
Read the original article Hit count: 346

Filed under:
|
|

I have the following haml code:

- @theLinks.each_index do |x|
   %br
   %form{:action=>'/Download', :method=>"post",:enctype=>"multipart/form-data"}
     %input{:type=>"submit", :name=>"#{@theLinks[x].url}", :value=>"Name: #{@theLinks[x].Name} Study Time: #{@theLinks[x].studyTime} Comments: #{@theLinks[x].comments}"}

Basically, for each person, list the time they participated in a study and the comments on the study. Right now, this renders as a set of buttons. I'd like to render it as a table, with each row clickable in the same way (ie, using the 'post' method, so that only the haml file has to be edited without touching the rest of the files).

Ideally, I'd also like to be able to sort the table by name, time, or comments, but that might be getting ahead of myself.

So how can I change this list of buttons into a table with clickable rows?

© Stack Overflow or respective owner

Related posts about haml

Related posts about buttons