i was wondering if there was any conventional way to find out (via the
partialname_counter, or any other way) which partial is the last in a
set of partials ( render :partial => ‘name’, :collection =>
‘@somethings’) so that i can display some kind of variable in the last
partial.
there’s got to be some neat way to do this?
(like setting :locals => {:abc => @var} if partialname_counter == LAST)
thanks,
'tis an interesting idea; i was actually visualizing some kind of rails
magic (like partialname_counter.last) to do the above, instead of
defining a each_with_index on an array of partials…
i already got the solution done by passing:
and then, in the partial itself i put my variable
<% if object == @objects.last %>…@var…<% end %>
which worked fine…i was just hoping to see if there was some kind of
rails method for doing this when calling a collection of partials that
could be inserted in the _partial.rhtml
either way, thanks for the speedy reply,
and regards back 2 u,
shai
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.