Last active
August 29, 2015 14:19
-
-
Save datt/657c1114ed8687ba45d3 to your computer and use it in GitHub Desktop.
temperory routes and controller for html pages for #FrontEnd. #tmp #controller create a folder named as tmp in views, whatever is the name of the page, can be in accessed from /page_name. e.g. if page name is /help_desk.html.haml, can be accessed as /help_desk
This file contains hidden or 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
| get '/tmp/:page' => 'tmp#index' | |
| get '/tmp/:page/:inner_page' => 'tmp#index' |
This file contains hidden or 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
| class TmpController < ApplicationController | |
| skip_before_filter :authenticate_user! | |
| layout :set_layout | |
| def index | |
| if params[:inner_page].present? | |
| render "tmp/#{params[:page]}/#{params[:inner_page]}" | |
| else | |
| render params[:page] | |
| end | |
| end | |
| private | |
| def set_layout | |
| params[:page].include?("admin") ? "admin" : "application" | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment