Last active
August 29, 2015 14:15
-
-
Save blizzarddreams/f92a63012ef1c1ed2dbe 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' | |
| Dir.glob('/controllers/*.rb').each { |file| require file } | |
| 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' | |
| #in /controllers/ | |
| 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