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
<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| %> |
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
<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? %> |
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 Array | |
def new_map | |
a = [] | |
self.each do |item| | |
a << yield(item) | |
end | |
a | |
end |
NewerOlder