Skip to content

Instantly share code, notes, and snippets.

View hogihung's full-sized avatar

John F. Hogarty hogihung

  • Left Foot Media, Inc.
  • Jacksonville, FL
View GitHub Profile
@hogihung
hogihung / topics_show.html.erb
Created March 24, 2014 01:31
Bloccit Topic#Show
<h1><%= @topic.name %></h1>
<% if policy(@topic).update? %>
<%= link_to "Edit Topic", edit_topic_path, class: 'btn btn-success' %>
<% end %>
<div class="row">
<div class="col-md-8">
<p class="lead"><%= @topic.description %></p>
<% @posts.each do |post| %>
@hogihung
hogihung / show.html.erb
Created March 24, 2014 01:14
Bloccit Posts#Show
<h1><%= markdown @post.title %></h1>
<div class="row">
<div class="col-md-8">
<small>
<%= image_tag(@post.user.avatar.tiny.url) if @post.user.avatar? %>
submitted <%= time_ago_in_words(@post.created_at) %> ago by
<%= @post.user.name %>
</small>
<p><%= markdown @post.body %></p>
<%= image_tag(@post.image) if @post.image? %>
@hogihung
hogihung / practice_blocks-new_map
Created March 16, 2014 19:31
Practice with blocks - new_map method
class Array
def new_map
a = []
self.each do |item|
a << yield(item)
end
a
end