Last active
September 15, 2015 16:37
-
-
Save orangewolf/628eaa433450bb6706ba to your computer and use it in GitHub Desktop.
Low Voltage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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