Skip to content

Instantly share code, notes, and snippets.

@nmerouze
Created July 13, 2010 09:42
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save nmerouze/473676 to your computer and use it in GitHub Desktop.
Save nmerouze/473676 to your computer and use it in GitHub Desktop.
gem "mongoid", ">= 2.0.0.beta9"
gem "bson_ext", ">= 1.0.3"
gem "haml", ">= 3.0.12"
gem "rspec-rails", ">= 2.0.0.beta.15", :group => :test
generators = <<-GENERATORS
config.generators do |g|
g.orm :mongoid
g.template_engine :haml
g.test_framework :rspec, :fixture => true, :views => false
end
GENERATORS
application generators
get "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js", "public/javascripts/jquery.js"
get "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js", "public/javascripts/jquery-ui.js"
get "http://github.com/rails/jquery-ujs/raw/master/src/rails.js", "public/javascripts/rails.js"
jquery = <<-JQUERY
module ActionView::Helpers::AssetTagHelper
remove_const :JAVASCRIPT_DEFAULT_SOURCES
JAVASCRIPT_DEFAULT_SOURCES = %w(jquery.js jquery-ui.js rails.js)
reset_javascript_include_default
end
JQUERY
initializer "jquery.rb", jquery
layout = <<-LAYOUT
!!!
%html
%head
%title #{app_name.humanize}
= stylesheet_link_tag :all
= javascript_include_tag :defaults
= csrf_meta_tag
%body
= yield
LAYOUT
remove_file "app/views/layouts/application.html.erb"
create_file "app/views/layouts/application.html.haml", layout
create_file "log/.gitkeep"
create_file "tmp/.gitkeep"
git :init
git :add => "."
docs = <<-DOCS
Run the following commands to complete the setup of #{app_name.humanize}:
% cd #{app_name}
% gem install bundler
% bundle install
% bundle lock
% script/rails generate mongoid:config
% script/rails generate rspec:install
DOCS
log docs
@shingara
Copy link

Why change Jquery default source ?

@nmerouze
Copy link
Author

  1. To follow the updates 2. To include jQuery UI 3. Because I took the template from Les Hill and modified it to match my needs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment