Sha256: 59aab7cec7b6508bedb12bf51a9161707631b450ea681dbb6beb551cdbfa3bb6

Contents?: true

Size: 662 Bytes

Versions: 1

Compression:

Stored size: 662 Bytes

Contents

Merb::Generators::ResourceControllerGenerator.template :controller_mongoid, :orm => :mongoid do |t|
  t.source = File.dirname(__FILE__) / "templates/resource_controller/app/controllers/%file_name%.rb"
  t.destination = "app/controllers" / base_path / "#{file_name}.rb"
end
 
[:index, :show, :edit, :new].each do |view|
  Merb::Generators::ResourceControllerGenerator.template "view_#{view}_mongoid".to_sym,
      :orm => :mongoid, :template_engine => :erb do |t|
    t.source = File.dirname(__FILE__) / "templates/resource_controller/app/views/%file_name%/#{view}.html.erb"
    t.destination = "app/views" / base_path / "#{file_name}/#{view}.html.erb"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
merb_mongoid-0.1.0 lib/generators/resource_controller.rb