Skip to content

Instantly share code, notes, and snippets.

@orangewolf
Last active September 15, 2015 16:37
Show Gist options
  • Save orangewolf/628eaa433450bb6706ba to your computer and use it in GitHub Desktop.
Save orangewolf/628eaa433450bb6706ba to your computer and use it in GitHub Desktop.
Low Voltage
# Routes
get 'templates/:name', as: :template
# Controller
class Templates < ApplicationController
def show
if params[:name] && File.exists?(Rails.root.join('app', 'views', 'templates', params[:name])
render "templates/#{params[:name]}"
end
end
# View at app/views/templates/about.haml
%h1 Hello {{ angular_user }}
# Links
link_to template_path('about')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment