Best way to require Haml on Rails3 engines

前端 未结 2 1995
北恋
北恋 2020-12-18 01:02

I\'m developing a Rails3 engine application, and I want to use Haml for the views.

First, what I have done was to add this to the engine Gemfile:

gem         


        
2条回答
  •  囚心锁ツ
    2020-12-18 01:21

    Two things are necessary. First, in the .gemspec:

    s.add_dependency 'haml', ['>= 3.0.0']
    

    And in your lib/gem_name.rb:

    require 'haml'
    

    And then run bundle both inside the gem and app directories.

提交回复
热议问题