File: install_generator.rb

package info (click to toggle)
ruby-nested-form 0.3.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 816 kB
  • sloc: javascript: 11,625; ruby: 659; makefile: 2
file content (17 lines) | stat: -rw-r--r-- 509 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module NestedForm
  module Generators
    class InstallGenerator < Rails::Generators::Base
      def self.source_root
        File.expand_path('../../../../vendor/assets/javascripts', __FILE__)
      end

      def copy_jquery_file
        if File.exists?('public/javascripts/prototype.js')
          copy_file 'prototype_nested_form.js', 'public/javascripts/nested_form.js'
        else
          copy_file 'jquery_nested_form.js', 'public/javascripts/nested_form.js'
        end
      end
    end
  end
end