문제

I want to set the name for my index page to "Your studio".

I used this:

%head
    %title ABCDE
%body
    blablablabla...

It did not appear to work. Please help to solve this simple question.

도움이 되었습니까?

해결책

In your layout, you can use:

%head
  %title= yield(:title)

And in your view:

= content_for(:title, "ABCDE")

Without repeating the head and title tags. Also you should only use the bodytag in the layout.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top