jipiboily / monologue

Monologue is a basic blogging engine. It is a Rails mountable engine you can mount in your already existing Rails app, or a in a new one! Enjoy.
http://jipiboily.com/2013/monologue-0-3-0-released-and-monologue-markdown
MIT License
477 stars 196 forks source link

availables methods/actions available with the @posts #272

Closed katawura closed 8 years ago

katawura commented 8 years ago

l am trying to pull the first post using below:

      <%= @posts.first do |post|%>
      <div class="large-6">
           <div class="article-out">
           <div class="figure"><img src="<%= asset_path( 'banner-med-07.jpg' ) %>" alt="Banner" /></div>

           <div class="aside">
           <h3><a href="#"><% post.title %></a></h3>
           <p>Edited by <% post.user.name %></p>
           <% link_to t("See Editorial"), post.full_url, class: "see-link" %>         
           </div>

           <div class="date-out">
           <div class="date-txt"><% post.published_at.to_date.day %></div>
           <div class="month-txt"><% post.published_at.to_date.strftime("%b") %>/<% post.published_at.to_date.strftime("%y")  %></div>
           </div>
           </div>
      </div> 
      <% end %>

But doesn't seem to pass please can you advise on the methods availble please?

msevestre commented 8 years ago

<%= @posts.first do |post|%> this looks weird to me propably should be sthg like <%post = @posts.first%> or sthg similar?

msevestre commented 8 years ago

What do you mean with But doesn't seem to pass?

katawura commented 8 years ago

It was not showing anything in my view. l stopped looping it and it worked for me. cheers