Skip to content

Instantly share code, notes, and snippets.

@rottmanj
Last active January 3, 2016 15:19
Show Gist options
  • Save rottmanj/8481633 to your computer and use it in GitHub Desktop.
Save rottmanj/8481633 to your computer and use it in GitHub Desktop.
Association suggestions for Bharat
In the file
https://github.com/bayyar/wikiful/blob/master/app/views/categories/show.html.erb#L8-L14
Change it to this:
<% @category.articles.each do |article| %>
<tr>
<td><%= link_to article.title.truncate(25), article %></td>
<td><%= article.created_at.strftime('%b %d, %Y') %></td>
<td><%= truncate(article.content, length:100) %></td>
</tr>
<% end %>
Remove line in the file
https://github.com/bayyar/wikiful/blob/master/app/controllers/categories_controller.rb#L8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment