Use Markdown to display updates

This commit is contained in:
Miles Gould
2012-11-09 12:06:18 +00:00
parent 78532ca2aa
commit 02fbae0cfc
6 changed files with 12 additions and 13 deletions

View File

@@ -48,7 +48,8 @@ gem 'capistrano-ext'
# To use debugger
# gem 'debugger'
# GROWSTUFF ADDITIONS BELOW HERE
# Markdown formatting for updates etc
gem 'bluecloth'
# user signup/login/etc
gem 'devise'

View File

@@ -30,6 +30,7 @@ GEM
multi_json (~> 1.0)
arel (3.0.2)
bcrypt-ruby (3.0.1)
bluecloth (2.2.0)
builder (3.0.4)
cape (1.5.0)
capistrano (2.13.5)
@@ -188,6 +189,7 @@ PLATFORMS
ruby
DEPENDENCIES
bluecloth
bundler (>= 1.1.5)
cape
capistrano

View File

@@ -6,4 +6,4 @@
%h3 Updates
%table
- @user.updates.each do |update|
= render :partial => "updates/single", :locals => { :update => update }
= render :partial => "updates/single", :locals => { :update => update, :subject => true }

View File

@@ -1,5 +1,6 @@
%div.update
%h3= link_to update.subject, update
- if subject
%h3= link_to strip_tags(update.subject), update
%div.update-meta
Posted by
@@ -7,7 +8,9 @@
at
= update.created_at
%div.update-body= update.body
%div.update-body
:markdown
#{ strip_tags update.body }
- if current_user == update.user
%div.update-actions

View File

@@ -1,6 +1,6 @@
= content_for :title, "Recent Growstuff member updates"
- @updates.each do |update|
= render :partial => "single", :locals => { :update => update }
= render :partial => "single", :locals => { :update => update, :subject => true }
= link_to 'New Update', new_update_path

View File

@@ -1,13 +1,6 @@
= content_for :title, @update.subject
%p
%i
= "By "
= link_to @update.user.username, member_path(@update.user)
= " at #{@update.created_at}"
%p
= @update.body
= render :partial => "single", :locals => { :update => @update, :subject => false }
= link_to 'Edit', edit_update_path(@update)
\|