Skip to content

Instantly share code, notes, and snippets.

@Soldo
Created March 30, 2012 09:50
Show Gist options
  • Save Soldo/2250439 to your computer and use it in GitHub Desktop.
Save Soldo/2250439 to your computer and use it in GitHub Desktop.
<% if @post.prev.present? %>
<%= link_to(("&#171; " + truncate(@post.prev.title)).html_safe,
refinery.blog_post_path(@post.prev),
:class => 'prev button') do %>
<h1>Previous</h1>
<% end -%>
<% end -%>
error:
undefined method `stringify_keys' for "/blog/posts/ovo-je-naslov-drugog-blog-posta":String
html I am expecting to get out of it:
<a class="prev button" href="/blog/ovo-je-naslov-drugog-blog-posta">
<h1>Previous</h1>
<h2>PAIRING OF THE WEEK: Pata C...</h2>
</a>
@magpieuk
Copy link

<%= link_to(refinery.blog_post_path(@post.prev)) do %>
<h1>Previous</h1>
<h2><%= "&#171; " + truncate(@post.prev.title)).html_safe %></h2>
<% end %>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment