Kevin Ballard <[EMAIL PROTECTED]> writes:
> Ok, revision 1318 modifies the prefix setting to allow you to postfix
> the page title instead of prefix. Current prefixes will remain
> prefixes, so nobody's blog titles change unexpectedly.
Oi! Not like that it shouldn't. We certainly shouldn't be exposing the
fact that it's implemented as an integer. Here's a suggestion:
class Content
def html_title
blog.title_prefix + title + blog.title_suffix
end
end
class Blog
def title_prefix
prepend_blog_name? ? "#{blog_name} : " : ''
end
def title_suffix
append_blog_name? ? " : #{blog_name}" : ''
end
def prepend_blog_name?
title_decoration == 'prepend'
end
def append_blog_name?
title_decoration == 'append'
end
end
Then the page_title helper simply becomes:
def page_title
@page.html_title
end
Mmm... fat model/thin controller kicks some serious buttock.
I'm still porting the test suite to rspec or you could expect a patch
to this effect...
--
Piers Cawley <[EMAIL PROTECTED]>
http://www.bofh.org.uk/
_______________________________________________
Typo-list mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/typo-list