Created
October 22, 2011 20:26
-
-
Save erikbuild/1306460 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
| module ApplicationHelper | |
| def markdown(text) | |
| Redcarpet.new(text).to_html.html_safe | |
| 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
| class CreateListing < ActiveRecord::Migration | |
| def self.up | |
| create_table :listings do |t| | |
| t.string :name | |
| t.string :location | |
| t.text :overview | |
| t.text :amenities | |
| t.text :lifestyle | |
| t.boolean :visible | |
| t.timestamps | |
| end | |
| end | |
| def self.down | |
| drop_table :pages | |
| 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
| class Listing < ActiveRecord::Base | |
| 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
| <% title @listing.name %> | |
| <div> | |
| <h3>Location</h3> | |
| <span><%= @listing.location %></span> | |
| </div> | |
| <div> | |
| <h3>Overview</h3> | |
| <%= markdown(@listing.overview) %> | |
| </div> | |
| <div> | |
| <h3> Amenities </h3> | |
| <%= markdown(@listing.overview) %> | |
| </div> | |
| <div> | |
| <h3>Lifestyle</h3> | |
| <%= markdown(@listing.overview) %> | |
| </div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment