Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Render from within partials without passing a local variable
- structure=""
- if(@page.theme_set = 1) #line 1
- render :partial => "first_theme.html", :locals => {:structure => structure}
- else
- render :partial => "second_theme.html", :locals => {:structure => structure}
- end
- concat(structure) #line 2
- <% structure << header %>
- <% structure << content_for_first_theme %>
- <% structure << footer %>
- if(@page.theme_set = 1) #this will always evaluate to true, use double equals (==) to find equality.
- <%= structure << footer %>
Advertisement
Add Comment
Please, Sign In to add comment