raylar üzerinde yakut ile Haml için bir yardımcı ya da bir şey oluşturma ve ben en kolay yolu html dosyası içine bu haml kodu eklemek nasıl bir sorum var:benim raylar uygulama ile Haml kullanıyorum
<div clas="holder">
<div class=top"></div>
<div class="content">
Content into the div goes here
</div>
<div class="bottom"></div>
</div>
Ve haml belgesinde şu şekilde kullanmak istiyorum:
%html
%head
%body
Maybee some content here.
%content_box #I want to get the code i wrote inserted here
Content that goes in the content_box like news or stuff
%body
Bunu yapmanın daha kolay bir yolu var mı? Bu kod ile
**unexpected $end, expecting kEND**
:
bu hata olsun
# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
def content_box(&block)
open :div, :class => "holder" do # haml helper
open :div, :class => "top"
open :div, :class => "content" do
block.call
open :div, :class => "bottom"
end
end
end
lütfen diğer cevaba yaptığım yorumu okuyun ve hangisi en çok Uygulamanın hızı açısından etkin mi? – Lisinge
hız farkı gerçekten nul.Yardımcı yöntemi kullanmak harika. – shingara