application.rhtml
1 2 3 4 5 6 7 8 9 10 11 12 13
<html> <head><title>Ruby</title></head> <body> <p> <%= yield %> </p> </body> </html> <%= render :partial=>'bug/bug_page' %>
Refactorings
No refactoring yet !
rupert
July 10, 2008, July 10, 2008 08:16, permalink
Not a refactoring as such, but you might want to look at the rails-footnotes plugin for inspiration as it sounds like you're wanting to do something very much along the same sort of lines:
Joe Grossberg
July 10, 2008, July 10, 2008 13:21, permalink
Intial thoughts:
* How many layout files do you have?
* Instead of putting the bug_page partial outside the html tags (yuck!), why don't you just enclose it in a div tag and use more specific CSS to make sure there's no conflict, e.g. (see code sample)
1 2
div#bug_page { background: #000; font-family: courier; } div#bug_page span.error { color: #f00; }
Hello,
- Let me explain the scenario. I am creating a plugin which has a requirement to put a
following partial line in every layout file (after end of </html> tag).
<%= render :partial=>'bug/bug_page' %>
- Now I am doing that manually by opening every layout file and pasting that code.
- Is there any other way to do that and also can I Refactor it in order to I don't want to put in every layout file.
- I just want that every page should get rendered by 'bug_page' partial file.
- Also I am rendering that outside the end of </html> tag because I don't want to get my css messed with application css.