新手问题 Rails 模板中如何处理标题?

kenneth · June 24, 2012 · Last by kenneth replied at June 24, 2012 · 3733 hits

模板页和详细页中如何处理标题 title? 定义在 layout/application.html.erb 中?应该如何处理?

<%= <a href="/page_title" class="user-mention" title="@page_title"><i>@</i>page_title</a> ? "#{t('site.name')} - #{<a href="/page_title.to_s" class="user-mention" title="@page_title.to_s"><i>@</i>page_title.to_s</a>}" : t('site.name') %>

toturial 上是这样的 application.html.erb

<%=yield :title%>

然后具体页 <%provide(:title,"your title")%>

谢谢大家的建议我用 content_for 实现了,http://www.appfp.com

You need to Sign in before reply, if you don't have an account, please Sign up first.