Sha256: 85401b17d39a2f1340eb665164602816427e75e70917bd7f7b4fcfea87ead7e6

Contents?: true

Size: 688 Bytes

Versions: 10

Compression:

Stored size: 688 Bytes

Contents

# encoding: utf-8

module Formtastic
  # Copies a config initializer to config/initializers/formtastic.rb
  #
  # @example
  # !!!shell
  #   $ rails generate formtastic:install
  class InstallGenerator < Rails::Generators::Base
    source_root File.expand_path('../../../templates', __FILE__)
    class_option :template_engine

    desc "Copies a config initializer to config/initializers/formtastic.rb"
    def copy_files
      copy_file 'formtastic.rb', 'config/initializers/formtastic.rb'
    end

    def copy_scaffold_template
      engine = options[:template_engine]
      copy_file "_form.html.#{engine}", "lib/templates/#{engine}/scaffold/_form.html.#{engine}"
    end
  end
end

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/formtastic-4.0.0/lib/generators/formtastic/install/install_generator.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/formtastic-4.0.0/lib/generators/formtastic/install/install_generator.rb
formtastic-4.0.0 lib/generators/formtastic/install/install_generator.rb
formtastic-4.0.0.rc1 lib/generators/formtastic/install/install_generator.rb
formtastic-3.1.5 lib/generators/formtastic/install/install_generator.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/formtastic-3.1.4/lib/generators/formtastic/install/install_generator.rb
formtastic-3.1.4 lib/generators/formtastic/install/install_generator.rb
formtastic-3.1.3 lib/generators/formtastic/install/install_generator.rb
formtastic-3.1.2 lib/generators/formtastic/install/install_generator.rb
formtastic-3.1.1 lib/generators/formtastic/install/install_generator.rb