Skip to content

Instantly share code, notes, and snippets.

@rbarazi
Created April 11, 2010 15:41
Show Gist options
  • Select an option

  • Save rbarazi/362821 to your computer and use it in GitHub Desktop.

Select an option

Save rbarazi/362821 to your computer and use it in GitHub Desktop.
[Beginning Rails 3] Listing 12-4. Showing tags in the article partial, app/views/articles/_article.html.erb
<%= div_for article do %>
<h3>
<%= link_to article.title, article %>
<% if article.owned_by? current_user %>
<span class='actions'>
<%= link_to t('general.edit'), edit_article_path(article) %>
<%= link_to t('general.delete'), article, :confirm => t('general.are_you_sure'), :method => :delete %>
</span>
<% end %>
</h3>
<% if article.tag_list.present? %>
<small>Tags: <%= article.tag_list %></small>
<% end %>
<%= simple_format raw(article.body) %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment