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
| <h3><%[email protected] %></h3> | |
| <p><em><%= @post.created_at.strftime("%e %b %Y %H:%m:%S%p") %></em></p> | |
| <%[email protected] %> |
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
| <h2>Posts</h2> | |
| <% unless @posts.empty? %> | |
| <% @posts.each do |post| %> | |
| <p> | |
| <a href="/view/<%= post.id %>"><%= post.title %></a> - | |
| <em><%= post.created_at.strftime("%e %b %Y %H:%m:%S%p") %></em> | |
| </p> | |
| <% end %> | |
| <% else %> | |
| <p>No posts available at the moment.</p> |
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 Post | |
| include DataMapper::Resource | |
| property :id, Serial | |
| property :title, String | |
| property :content, Text | |
| property :created_at, DateTime | |
| end | |
| DataMapper.finalize |
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 '/about' do | |
| erb: about | |
| 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
| <div id="sidebar-wrapper"> | |
| <div id="sidebar"> | |
| <%= erb :'partials/twitter' %> | |
| </div> | |
| </div> |
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
| <div id="content-wrapper"> | |
| <div id="content"> | |
| <%= yield %> | |
| </div> | |
| </div> |
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 '/' do | |
| erb :index | |
| 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
| #database connection | |
| DataMapper.setup(:default, ENV['DATABASE_URL'] || "sqlite3://#{Dir.pwd}/development.db") |
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' | |
| require 'data_mapper' | |
| require 'dm-migrations' | |
| require 'dm-timestamps' |
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
| <?php | |
| class Testing_example extends CI_Driver | |
| { | |
| private $CI; | |
| public function __construct() | |
| { | |
| $this->CI =& get_instance(); | |
| $this->CI->load->database(); | |
| } |