Monday, March 7, 2011

[Rails] Re: Trouble with titleize

Frederick Cheung wrote in post #986019:
> On 7 Mar 2011, at 17:42, James Byrne <lists@ruby-forum.com> wrote:
>
>> In one of my views I have this code:
>>
>> <%=content_tag :h2, :header do-%>
>> <%=yield(:page_title).html_safe?-%>
>> <%=yield(:page_title).titleize-%>
>> <%- end -%>
>>
>
> What exactly does yield(:page_title) return before you titleize it?
>
> Fred

<%-content_for :page_title,
"a boy & his dog"
-%>

<div class="welcome" id="welcome_show_page">

<%=content_tag :h2, :header do-%>
<%=yield(:page_title)-%>
<%- end -%>

displays:

a boy & his dog

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate