Partial + custom class

Hi all,

I am using partial:
<%= render :partial => ‘post’, :collection => @posts %>

_post.rhtml

  • <%= post.created_at %>

    . .
  • this will display my last 4 posts next to each other, but each of this

  • blocks have right-margin 33px and I would liko to set the last
  • block with no right-margin. What I need to do is to add to last
  • block to not to set the right margin.

    Any help would be most welcome.
    Cheers P.

  • On Fri, Jan 16, 2009 at 1:47 PM, Petr B.
    [email protected] wrote:

    Hi all,

    I am using partial:
    <%= render :partial => ‘post’, :collection => @posts %>

    _post.rhtml

  • <%= post.created_at %>

  • You can use the last method of Array to figure out if you’re on the last
    post

    <% if post == @posts.last -%>

    <% if post == @posts.last -%>

    Hi Franz,

    works like a charm! Thank you.

    P.

    This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

    | Privacy Policy | Terms of Service | Remote Ruby Jobs