Shai -
Interesting Idea.
If its a display issue then would displaying it after the loop calling the
collection of partials be acceptible?
Example:
# in controller
render :action => ''list''
# in list.rhtml
<%= render :partial => ''mypartial'', :collection =>
@mypartials %>
<%= display_cool_stuff_for( @var ) -%>
---------------------
If its a data issue then I suppose the following might work.
# in list.rhtml
<% @mypartials.each_with_index do | part, ii | %>
<% if ii + 1 == @mypartials.size %>
<%= render :partial => ''mypartial'', :locals=> {
:mypartial => part,
:other => @var } %>
<% else %>
<%= render :partial => ''mypartial'', :locals => {
:mypartial => part } %>
<% end %>
<% end %>
------------------------
Regards,
- trav
On 7/13/06, shai <shaiguitar@yahoo.com> wrote:>
> Hi,
>
> 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,
>
> s
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
--
p [151,40,154,157,166,145,40,162,165,142,171].collect { |ii| eval
''"\\''+ii.to_s+''"'' }.join
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060713/ad34dc52/attachment-0001.html