Sha256: cf1b01a37fbec6e720c889162a0972958e2895715366c30f45339d9450a5f60d

Contents?: true

Size: 638 Bytes

Versions: 7

Compression:

Stored size: 638 Bytes

Contents

module Assets
  class AutocompleteGenerator < Rails::Generators::NamedBase
    source_root File.expand_path('../templates', __FILE__)
    argument :name, type: :string, default: "RaroCrud"

    def copy_initializer_file
      inject_into_file "app/assets/javascripts/application.js", after: "//= require jquery_ujs" do
<<-JS

//= require autocomplete/jquery-ui-autocomplete
//= require autocomplete/autocomplete-rails
JS
      end
      append_file 'Gemfile' do
        <<-RUBY


# autocomplete
gem 'rails-jquery-autocomplete'
        RUBY
      end
      Bundler.with_clean_env do
        run "bundle install"
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
raro_generator-0.2.1 lib/generators/assets/autocomplete/autocomplete_generator.rb
raro_generator-0.1.1 lib/generators/assets/autocomplete/autocomplete_generator.rb
raro_generator-0.1.0 lib/generators/assets/autocomplete/autocomplete_generator.rb
raro_generator-0.0.4 lib/generators/assets/autocomplete/autocomplete_generator.rb
raro_generator-0.0.3 lib/generators/assets/autocomplete/autocomplete_generator.rb
raro_generator-0.0.2 lib/generators/assets/autocomplete/autocomplete_generator.rb
raro_generator-0.0.1 lib/generators/assets/autocomplete/autocomplete_generator.rb