SammyLin / redactor-rails

This repo is deprecated. Please check out official gem for Redactor 2. https://github.com/Redactor2/redactor2_rails
MIT License
389 stars 253 forks source link

Add a Document RedactorAsset? #22

Closed neotericdesign closed 11 years ago

neotericdesign commented 11 years ago

Hey!

We actually forked your project in the hopes of starting the work on this ourselves, but I've run into an issue trying to get a test environment setup around a new Document class that subclasses from Asset.

There are just too many dependencies to get it running.

# My latest attempt that is awful
require 'minitest/autorun'
require './lib/generators/redactor/templates/base/carrierwave/uploaders/redactor_rails_document_uploader'
module RedactorRails; class Orm; end; end
class ActiveRecord; class Base; end; class AssetBase; end; end
require './lib/generators/redactor/templates/active_record/carrierwave/redactor/asset'
require './lib/generators/redactor/templates/active_record/carrierwave/redactor/document'

require './test/helpers/redactor_assets/test_implements_redactor_asset_interface'

module RedactorRails
  class DocumentTest < MiniTest::Unit::TestCase
    include ImplementsRedactorAssetInterface

    def setup
      @document = @object = Document.new
    end
  end
end

So I'm wondering you have any tips for how we might go about beginning this work? We'd like for our clients to be able to upload Document-type files, like PDF, DOC, etc... just as fantastically easily as they do with Images!

Let me know what I can do to pitch in, we'd really like to contribute! Thanks

neotericdesign commented 11 years ago

For reference, the source code we have right now lives here

https://github.com/neotericdesign/redactor-rails/tree/feature/upload-documents

joemsak commented 11 years ago

Working on this now, pull request incoming