Skip to content

Instantly share code, notes, and snippets.

@daichirata
Created March 4, 2012 15:04
Show Gist options
  • Save daichirata/1973415 to your computer and use it in GitHub Desktop.
Save daichirata/1973415 to your computer and use it in GitHub Desktop.
lokka_plugin
module Lokka
module HelloGem
def self.registered(app)
app.get "/admin/plugins/hello_gem" do
haml view_path('test.haml'), :layout => :"admin/layout"
end
app.helpers do
def view_path(name)
view_path = File.expand_path(File.dirname(__FILE__) + "/path/to/view/#{name}")
File.open(view_path).read
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment