Hi,
I often find myself using partials in the following way when they are
intended for use with both javascript and html rendering:
-- page.html.erb
render :partial => ''partial''
-- page.rjs
page.replace ''element'',
:partial => ''partial'', :locals => {:hidden =>
true}
page.visual_effect :appear, ''element''
--_partial.html.erb
<%
hidden ||= nil
%>
<div <%= ''style="display: none"'' if hidden
%>>
Whatever
</div>
I was wondering whether anyone could suggest a better way of doing
this as I don''t really like using the hidden ||= nil at the top of
every partial that is intended for this usage?
Thanks in advance,
Toby
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---