netoneko / ckeditor

MIT License
0 stars 0 forks source link

ck editor file download not working #1

Open regmiprem opened 11 years ago

regmiprem commented 11 years ago

I am using ck editor in rails having database mongo db. I followed the link https://github.com/galetahub/ckeditor . I am succes in doing work with the help of ckeditor. since my view.html.erb code is like this

<%= f.cktext_area :description, :toolbar => 'Easy', :width => 800, :height => 200 %><br>

and my show page is

<%= raw@department.description %>

it does not works for file cases. I have my model attachment_file.rb is

class Ckeditor::AttachmentFile < Ckeditor::Asset
  has_mongoid_attached_file :data,
                            :url => "/ckeditor_assets/attachments/:id/:filename",
                            :path => ":rails_root/public/ckeditor_assets/attachments/:id/:filename"

  validates_attachment_size :data, :less_than => 100.megabytes
  validates_attachment_presence :data

  def url_thumb
    @url_thumb ||= Ckeditor::Utils.filethumb(filename)
  end
end

It is working for image cases but not working for zip file or any attachement. when it comes to the file cases it can upload file successfully with its path. but to download that file by user it doesnot work. I mean backend works properly for all features. But lacks to download that uploaded file stops by

`javascript:void(0)/*130*/

recently i change the attachment .js as u mention . But again it is not working.

netoneko commented 11 years ago

Use branch void like this in your Gemfile

gem 'ckeditor-rails', :git => 'https://github.com/netoneko/ckeditor', :branch => 'void'
regmiprem commented 11 years ago

Could not find gem 'ckeditor-rails (>= 0) ruby' in https://github.com/netoneko/ckeditor (at void). Source does not contain any versions of 'ckeditor-rails (>= 0) ruby' This error arises when i do as above

netoneko commented 11 years ago

Sorry, this is the right Gemfile string:

gem "ckeditor", :git => 'https://github.com/netoneko/ckeditor.git', :branch => 'void' #"~>3.7.0rc2"