Skip to content

Commit

Permalink
Done.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carl Lerche committed Aug 27, 2009
1 parent f7929ce commit 4637c0e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sinatrails.rb
Expand Up @@ -110,6 +110,7 @@ def process_action(*)
# Loop over the template render methods and define them # Loop over the template render methods and define them
%w(haml erb builder).each do |type| %w(haml erb builder).each do |type|
define_method(type) do |thing| define_method(type) do |thing|
return sinatra_render_inline(thing, type) if thing.is_a?(String)
return sinatra_render_file(thing) return sinatra_render_file(thing)
end end
end end
Expand All @@ -118,5 +119,9 @@ def process_action(*)
def sinatra_render_file(name) def sinatra_render_file(name)
render :template => name.to_s render :template => name.to_s
end end

def sinatra_render_inline(string, type)
render :inline => string, :type => type
end
end end
end end

0 comments on commit 4637c0e

Please sign in to comment.