Skip to content

Commit

Permalink
Adding action view to the rack app
Browse files Browse the repository at this point in the history
  • Loading branch information
timmatheson committed May 27, 2009
1 parent ab03811 commit 31d57ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/unfuddle_notifier.rb
@@ -1,14 +1,12 @@
class UnfuddleNotifier
require 'action_view'

def initialize(app)
@app = app
end

def call(env)
@session = Unfuddle::Session.new
@project = Unfuddle::Project.find(:one, :from => "/projects/20935")
@tickets = @project.tickets
status, headers, response = @app.call(env)
[status, headers, "<div style='background-color: blue; color: white; font-weight: bold;'>
#{@project.title} has #{@tickets.size} tickets</div>" + response.body]
[status, headers, ActionView::Template.render("panel", "views") + response.body]
end
end
3 changes: 3 additions & 0 deletions views/panel.html.erb
@@ -0,0 +1,3 @@
<div id="panel" style="color: white; background: #000;">
<%= "Foobar ERB" %>
</div>

0 comments on commit 31d57ba

Please sign in to comment.