Guest User

Untitled

a guest
Apr 26th, 2012
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  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 %>
Advertisement
Add Comment
Please, Sign In to add comment