Skip to content

Instantly share code, notes, and snippets.

@erikbuild
Created October 22, 2011 20:26
Show Gist options
  • Select an option

  • Save erikbuild/1306460 to your computer and use it in GitHub Desktop.

Select an option

Save erikbuild/1306460 to your computer and use it in GitHub Desktop.
module ApplicationHelper
def markdown(text)
Redcarpet.new(text).to_html.html_safe
end
end
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
class Listing < ActiveRecord::Base
end
<% 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