public
Created

view method

  • Download Gist
view.rb
Ruby
1 2 3 4
get '/view/:link' do
halt 404 unless File.exist?("views/posts/#{params[:link]}.md")
markdown :"posts/#{params[:link]}", :layout_engine => :erb
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.