Haml-rails not working in Rails 3 Engine -


i have created rails engine (as per rails guides) using:

rails plugin new address_book --full --mountable 

i proceeded follow instructions in the answer question, trying both "haml" gem, "haml-rails" gem (i latter, use in parent application too).

for reason, after running bundle, , then

rails g controller pages temp 

it still creates .erb files instead of .haml files.

any assistance appreciated. code follows:

the 'lib/address_book.rb' file:

require "address_book/engine" require "haml-rails"  module addressbook end 

the 'address_book.gemspec' file:

$:.push file.expand_path("../lib", __file__)  # maintain gem's version: require "address_book/version"  # describe gem , declare dependencies: gem::specification.new |s|   s.name        = "address_book"   s.version     = addressbook::version   s.authors     = ["todo: name"]   s.email       = ["todo: email"]   s.homepage    = "todo"   s.summary     = "todo: summary of addressbook."   s.description = "todo: description of addressbook."    s.files = dir["{app,config,db,lib}/**/*"] + ["mit-license", "rakefile", "readme.md"]   s.test_files = dir["test/**/*"]    s.add_dependency "rails", "~> 3.2.5"   s.add_dependency "haml-rails"   # s.add_dependency "jquery-rails"    s.add_development_dependency "sqlite3" end 

the 'gemfile' file:

source "http://rubygems.org"  gemspec  gem "jquery-rails" 

try this:

add gem spec:

s.add_dependency 'haml-rails' 

than go on engine.rb file , add:

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

last step: add engines gemspec:

gem 'haml-rails' 

your generators produce haml views.


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -