Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Done.

  • Loading branch information...
commit 4637c0e84beaf1886e353129835ef5c3aaf61b18 1 parent f7929ce
Carl Lerche authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 sinatrails.rb
View
5 sinatrails.rb
@@ -110,6 +110,7 @@ def process_action(*)
# Loop over the template render methods and define them
%w(haml erb builder).each do |type|
define_method(type) do |thing|
+ return sinatra_render_inline(thing, type) if thing.is_a?(String)
return sinatra_render_file(thing)
end
end
@@ -118,5 +119,9 @@ def process_action(*)
def sinatra_render_file(name)
render :template => name.to_s
end
+
+ def sinatra_render_inline(string, type)
+ render :inline => string, :type => type
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.