I have this code:
<%= @r2_blog_posts = Refinery::Blog::Post.recent(2) %>
<%= link_to(@r2_blog_posts.first) do %>
<%= image_tag(@r2_blog_posts.first.teaser_first_img) %>
<% end %>
I’m getting this error for second line: undefined method `post_path’ for #<#:0x0000000841c168>
teaser_first_img is returning src attribute of the first image in teaser
I have not used this engine, but I think that the posts – is a nested or namespaced resource. So you need to know at first path for post:
rake routesand then use something like:
link_to blog_post_path(@r2_blog_posts.first)– changeblog_post_pathto actual path