Created
February 18, 2015 03:11
-
-
Save blizzarddreams/b4ed5f7546e892d14117 to your computer and use it in GitHub Desktop.
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
| require 'sinatra/base' | |
| require 'sinatra' | |
| require 'mongoid' | |
| require './controllers/post_controller.rb' | |
| configure do | |
| Mongoid.load!("./mongoid.yml") | |
| end | |
| class ApplicationController < Sinatra::Base | |
| set :root, File.dirname(__FILE__) | |
| enable :sessions | |
| get '/' do | |
| erb :login | |
| end | |
| end | |
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
| require 'sinatra' | |
| class PostController < ApplicationController | |
| get '/posts' do | |
| @post = Post.all | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment