Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modify code #94

Open
wants to merge 44 commits into
base: master
Choose a base branch
from
Open

modify code #94

wants to merge 44 commits into from

Conversation

songgz
Copy link

@songgz songgz commented Nov 10, 2017

modify code

@Macrow
Copy link
Owner

Macrow commented Nov 10, 2017

辛苦~
我看到代码改了很多,但情况没有说明,能否简要说明一下?
另外对于kindeditor本身,我原则是少修改,尽量不去动,主要是便于跟随版本更新,我看你的改动挺多,能否也简要说明一下?

@songgz
Copy link
Author

songgz commented Nov 10, 2017

1、assets_controller.rb
这里的list方法中:用到了Dir.chdir(dir)和Dir.chdir(Rails.public_path)改变了Rails Controller的prepend_view_path方法的反回值,修改了视图路径。
其它算是整理代码逻辑!

@songgz
Copy link
Author

songgz commented Nov 10, 2017

  1. asset_uploader.rb
    这里的filename方法中的Digest::MD5.hexdigest(File.dirname(current_path)).slice(0, 12)有问题,取路径摘要可能会重复。
    这里的self.save_upload_info?方法,好像没达到表述的目的。

@Macrow
Copy link
Owner

Macrow commented Nov 12, 2017

1.关于改变prepend_view_path的情况我不太明白,Dir.chdir(dir)和Dir.chdir(Rails.public_path)会影响模板加载吗?

2.Digest::MD5.hexdigest(File.dirname(current_path)).slice(0, 12)这样取文件名不会重复的,之所以裁剪是因为文件名实在太长。

3.self.save_upload_info?方法主要是判断是否把文件信息存入数据库,如果运行了

rails generate rails_kindeditor:migration

该方法就会返回true

========= 华丽的分割线 =========

另外:

1.你的代码是否经过测试?我clone了你的https://github.com/songgz/rails_kindeditor的代码,然后在本地做调试,上传图片,和加载图片空间都出现了错误,我看了代码,有一些基本的判断你去掉了,确认你的代码是否已逐一调试?

2.你对于kindeditor.js的修改很多,我建议不要动官方代码,这部分修改意见可否提交到https://github.com/kindsoft/kindeditor的官方去?

songgz and others added 2 commits March 6, 2018 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants