From 272923d08d044398be4377c09b2a6742b563238c Mon Sep 17 00:00:00 2001 From: benji Date: Tue, 8 Sep 2015 19:39:13 +0200 Subject: [PATCH] Convert erb to haml files --- app/views/users/index.html.erb | 20 -------------------- app/views/users/index.html.haml | 13 +++++++++++++ app/views/users/show.html.erb | 28 ---------------------------- app/views/users/show.html.haml | 21 +++++++++++++++++++++ 4 files changed, 34 insertions(+), 48 deletions(-) delete mode 100644 app/views/users/index.html.erb create mode 100644 app/views/users/index.html.haml delete mode 100644 app/views/users/show.html.erb create mode 100644 app/views/users/show.html.haml diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb deleted file mode 100644 index f673952..0000000 --- a/app/views/users/index.html.erb +++ /dev/null @@ -1,20 +0,0 @@ -

Users

- - - - - - - - - - - <% @users.each do |user| %> - - - - - - <% end %> - -
IDNameBalance
<%= user.id %><%= user.name %><%= user.balance %>
diff --git a/app/views/users/index.html.haml b/app/views/users/index.html.haml new file mode 100644 index 0000000..1eb3f5e --- /dev/null +++ b/app/views/users/index.html.haml @@ -0,0 +1,13 @@ +%h2 Users +%table + %thead + %tr + %th ID + %th Name + %th Balance + %tbody + - @users.each do |u| + %tr + %td= u.id + %td= u.name + %td= u.balance diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb deleted file mode 100644 index 6719a08..0000000 --- a/app/views/users/show.html.erb +++ /dev/null @@ -1,28 +0,0 @@ -

<%= @user.name %>

- - - - - - - - - - - - - - - <% @user.transactions.each do |transaction| %> - - - - - - - - - - <% end %> - -
IDDebtorCreditorAmountOriginMessageTime
<%= transaction.id %><%= transaction.debtor.name %><%= transaction.creditor.name %><%= transaction.amount %><%= transaction.origin %><%= transaction.message %><%= transaction.created_at %>
diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml new file mode 100644 index 0000000..84fbea6 --- /dev/null +++ b/app/views/users/show.html.haml @@ -0,0 +1,21 @@ +%h2= @user.name +%table + %thead + %tr + %th ID + %th Debtor + %th Creditor + %th Amount + %th Origin + %th Message + %th Time + %tbody + - @user.transactions.each do |t| + %tr + %td= t.id + %td= t.debtor.name + %td= t.creditor.name + %td= t.amount + %td= t.origin + %td= t.message + %td= t.created_at