القضبان السقالة، وخلق. haml بدلا من. المشاهدات إرب



بعد أن تعبت من إعادة بيع ديون. ملفات إرب ل. haml توجهت عن وسيلة لتعديل مولد القضبان التي من شأنها خلق. عرض الملفات haml بدلا من. ملفات عرض إرب.

بعد فترة من الوقت، وأنا وجدت بالضبط ما احتاجه. 'haml القضبان' هو اسم من الحل. هذا هو كيف يمكنك أن تفعل ذلك.

أضف السطر التالي إلى Gemfile الخاص:

gem 'haml-rails'

Then run the bundler (bundle install).

Now append the following lines in your application.rb file (at the end of Application class):

config.generators do |g|
   g.template_engine :haml
end

That’s it. Your new scaffolds will generate .haml files (and obviously haml syntaxes) for you.

This is much easier than Haml-scaffold .

  • Nhm tanveer

    Hi don’t limit Haml gem to development. You can’t use it on production mode then gem won’t load.

  • The HungryCoder

    Yes, you are right for this code fragment. However, it was ok for me as I already had

    gem 'haml'

    in my Gemfile. That was enabling .haml in production. But I overlooked the issue that two gems were not needed for this purpose. Thanks for spotting :) .

  • almirsarajcic

    Great post, thanks.