Sha256: 466274f5ccee4f65377a44e21aa8d28eb2f4fd22040771681f02b0a11a22734a

Contents?: true

Size: 858 Bytes

Versions: 7

Compression:

Stored size: 858 Bytes

Contents

# Application template recipe for the rails_apps_composer.

if config['draggable']
  if recipes.include? 'jquery'
    if recipes.include? 'home_page'
      after_bundler do
        append_file 'app/views/home/index.html.erb' do <<-ERB
<div id="draggable" class="ui-widget-content"> 
  <p>Drag me around</p> 
</div> 
ERB
        end
        remove_file 'app/assets/javascripts/draggable.js'
        create_file 'app/assets/javascripts/draggable.js' do
          <<-ERB
$(function() { 
  $( "#draggable" ).draggable(); 
});
ERB
        end
      end
    end
  else
    say_wizard "You need to install jQuery to use the Draggable effect."
  end
end

__END__

name: Draggable
description: "Drag elements around page."
author: Andrew Dixon

category: assets

config:
  - draggable:
      type: boolean
      prompt: Would you like to add Draggable functionality?

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rails_apps_composer-1.0.26 recipes/draggable.rb
rails_apps_composer-1.0.25 recipes/draggable.rb
rails_apps_composer-1.0.24 recipes/draggable.rb
rails_apps_composer-1.0.23 recipes/draggable.rb
rails_apps_composer-1.0.22 recipes/draggable.rb
rails_apps_composer-1.0.21 recipes/draggable.rb
rails_apps_composer-1.0.20 recipes/draggable.rb