Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prototype Support / Generator Installs the correct backend JS file depending on JS Framework #2

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Conditionally copy the nested_form javascript depending on which
javascript framework is used.  Currently, if not prototype, then assume
jquery.
Peter Giacomo Lombardo committed Feb 9, 2011
commit a44830fad14c359eb55a7331c12496b0ce6bfc12
9 changes: 7 additions & 2 deletions lib/generators/nested_form/install_generator.rb
Original file line number Diff line number Diff line change
@@ -7,8 +7,13 @@ def self.source_root


def copy_jquery_file
copy_file 'nested_form.js', 'public/javascripts/nested_form.js'
stat = File.stat('public/javascripts/prototype.js')
if stat.file?
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
end