Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 26th, 2012  |  syntax: None  |  size: 0.58 KB  |  hits: 17  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Render from within partials without passing a local variable
  2. structure=""
  3. if(@page.theme_set = 1)                          #line 1
  4.   render :partial => "first_theme.html", :locals => {:structure => structure}
  5. else
  6.   render :partial => "second_theme.html", :locals => {:structure => structure}
  7. end
  8. concat(structure)                                #line 2
  9.        
  10. <% structure << header %>
  11. <% structure << content_for_first_theme %>
  12. <% structure << footer %>
  13.        
  14. if(@page.theme_set = 1)   #this will always evaluate to true, use double equals (==) to find equality.
  15.        
  16. <%= structure << footer %>