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