Sha256: e107fa32bf6fbb802291fec09ce3e80a63348d83b54b17e9ff1699cf7a47f7f2

Contents?: true

Size: 857 Bytes

Versions: 43

Compression:

Stored size: 857 Bytes

Contents

module FlexaLib

  class LookupGenerator < Rails::Generators::NamedBase
    argument :colunas, :type => :array
  
    source_root File.expand_path('../templates', __FILE__)  
    class_option :orm
    def generate_lookup
      template "lookup_controller.rb", "app/controllers/lookups/#{plural_file_name}_controller.rb"
      template "lookup_view.erb", "app/views/lookups/#{plural_file_name}/index.html.erb"
      route("match 'lookups/#{plural_file_name}' => 'lookups/#{plural_file_name}#index', :as => :lookups_#{plural_file_name}")
    end
    hook_for :test_framework, :in => :rails, :as => :controller do |instance, controller|
      instance.invoke controller, [ "lookups/"<<instance.name.pluralize ]
    end
    #hook_for :test_framework, :in => :rails, :as => :controller
    #hook_for :test_framework, :in => :rails, :as => :view
    
  end
  
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
flexa_lib-0.5.2 lib/generators/flexa_lib/lookup/lookup_generator.rb
flexa_lib-0.5.1 lib/generators/flexa_lib/lookup/lookup_generator.rb
flexa_lib-0.5.0 lib/generators/flexa_lib/lookup/lookup_generator.rb
flexa_lib-0.3.9 lib/generators/flexa_lib/lookup/lookup_generator.rb
flexa_lib-0.3.8 lib/generators/flexa_lib/lookup/lookup_generator.rb
flexa_lib-0.3.7 lib/generators/flexa_lib/lookup/lookup_generator.rb
flexa_lib-0.3.6 lib/generators/flexa_lib/lookup/lookup_generator.rb
flexa_lib-0.3.5 lib/generators/flexa_lib/lookup/lookup_generator.rb
flexa_lib-0.3.4 lib/generators/flexa_lib/lookup/lookup_generator.rb
flexa_lib-0.3.3 lib/generators/flexa_lib/lookup/lookup_generator.rb
flexa_lib-0.3.2 lib/generators/flexa_lib/lookup/lookup_generator.rb
flexa_lib-0.3.1 lib/generators/flexa_lib/lookup/lookup_generator.rb
flexa_lib-0.3.0 lib/generators/flexa_lib/lookup/lookup_generator.rb
flexa_lib-0.2.9 lib/generators/flexa_lib/lookup/lookup_generator.rb
flexa_lib-0.2.8 lib/generators/flexa_lib/lookup/lookup_generator.rb
flexa_lib-0.2.7 lib/generators/flexa_lib/lookup/lookup_generator.rb
flexa_lib-0.2.6 lib/generators/flexa_lib/lookup/lookup_generator.rb
flexa_lib-0.2.5 lib/generators/flexa_lib/lookup/lookup_generator.rb
flexa_lib-0.2.4 lib/generators/flexa_lib/lookup/lookup_generator.rb
flexa_lib-0.2.3 lib/generators/flexa_lib/lookup/lookup_generator.rb