Commit b7329674
Changed files (2)
app
models
views
cakes
app/models/creation.rb
@@ -7,6 +7,7 @@ class Creation < ActiveRecord::Base
has_many :favorites, :dependent => :destroy
has_many :comments, dependent: :destroy
acts_as_taggable_on :tags
+ acts_as_taggable_on :tools
alias_method :author, :user
default_scope -> { order(created_at: :desc) }
app/views/cakes/_show.html.erb
@@ -34,6 +34,14 @@
</div>
<% end %>
</div>
+ <% if @creation.tools.any? %>
+ <p>Tools:</p>
+ <ul>
+ <% @creation.tools.each do |tool| -%>
+ <li><%= link_to tool.name, products_path(q: tool.name) %></li>
+ <% end -%>
+ </ul>
+ <% end -%>
<p><%= render_markdown(@creation.story).html_safe -%></p>
</div>
</div>