Sha256: caca90033c358245764dc8ea25bdeb7083137ec4c3b577b351a605b38af6ed6d

Contents?: true

Size: 661 Bytes

Versions: 1

Compression:

Stored size: 661 Bytes

Contents

require 'rails/generators/resource_helpers'
module Ixtlan
  class ScaffoldGenerator < Rails::Generators::NamedBase
    include Rails::Generators::ResourceHelpers

    source_root File.expand_path('../../templates', __FILE__)
    
#    check_class_collision :suffix => "Guard"
    
    def create_guard_files
      puts "ASD"
      template 'guard.rb', File.join('app', 'guards', class_path, "#{plural_file_name}_guard.rb")
    end
    
    def guard_class_name
      controller_class_name
    end

    def aliases
      { :new => :create, :edit => :update }
    end

    def actions
      ['index', 'show', 'create', 'update', 'destroy']
    end
    
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ixtlan-guard-0.1.0 lib/generators/ixtlan/scaffold/scaffold_generator.rb