Skip to content

Commit

Permalink
Can look at all emails
Browse files Browse the repository at this point in the history
  • Loading branch information
mlandauer committed Dec 12, 2011
1 parent 0b12b56 commit 3f6bcd6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app.rb
Expand Up @@ -52,6 +52,13 @@
end

get '/emails' do
@emails = EmailReply.all
haml :'emails/index'
end

get '/emails/:id' do
@email = EmailReply.find(params[:id])
haml :'emails/show'
end

# Set config from local file for development (and use environment variables on Heroku)
Expand Down
12 changes: 12 additions & 0 deletions views/emails/index.haml
@@ -0,0 +1,12 @@
%h1 All email replies to tweets

%table
%tr
%th From
%th Subject
- @emails.each do |email|
%tr
%td= email.from
%td
%a{:href => "/emails/#{email.id}"}
= email.subject
5 changes: 5 additions & 0 deletions views/emails/show.haml
@@ -0,0 +1,5 @@
%p From: #{@email.from}
%p Subject: #{@email.subject}
%p= @email.stripped_text
%p
This email was in reply to a tweet

0 comments on commit 3f6bcd6

Please sign in to comment.