Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Render slim views without overloading find_template in sinatra

  • Loading branch information...
commit 92eb5ffa94948e98cccfaee315f04bd0f0690e2c 1 parent 543a0a8
@zquestz zquestz authored
Showing with 3 additions and 9 deletions.
  1. +3 −9 lib/sidekiq/failures/web_extension.rb
View
12 lib/sidekiq/failures/web_extension.rb
@@ -3,20 +3,14 @@ module Failures
module WebExtension
def self.registered(app)
- app.helpers do
- def find_template(view, *a, &b)
- dir = File.expand_path("../views/", __FILE__)
- super(dir, *a, &b)
- super
- end
- end
-
app.get "/failures" do
+ view_path = File.join(File.expand_path("..", __FILE__), "views")
+
@count = (params[:count] || 25).to_i
(@current_page, @total_size, @messages) = page("failed", params[:page], @count)
@messages = @messages.map { |msg| Sidekiq.load_json(msg) }
- slim :failures
+ render(:slim, File.read(File.join(view_path, "failures.slim")))
end
app.post "/failures/remove" do
Please sign in to comment.
Something went wrong with that request. Please try again.