Sha256: d90562b1fb0daf891cf5a8e4feec364b89cef33a32532c820aac4975ab446fb7

Contents?: true

Size: 654 Bytes

Versions: 2

Compression:

Stored size: 654 Bytes

Contents

namespace :datagrid do

  desc "Copy table partials into rails application"
  task :copy_partials do
    require "fileutils"
    def copy_template(path)
      gem_app   = File.expand_path("../../../app", __FILE__)
      rails_app = (Rails.root + "app").to_s
      full_path = "#{rails_app}/#{File.dirname path}"
      puts "* copy #{full_path}"
      FileUtils.mkdir_p full_path
      FileUtils.cp "#{gem_app}/#{path}", full_path
    end
    copy_template "views/datagrid/_table.html.erb"
    copy_template "views/datagrid/_head.html.erb"
    copy_template "views/datagrid/_order_for.html.erb"
    copy_template "views/datagrid/_row.html.erb"
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
datagrid-0.8.1 lib/tasks/datagrid_tasks.rake
datagrid-0.8.0 lib/tasks/datagrid_tasks.rake