tsechingho / ckeditor-rails

Integrate CKEditor javascript library with Rails asset pipeline
https://github.com/tsechingho/ckeditor-rails
MIT License
213 stars 132 forks source link

How to customize the path of the .js and .css files in ckeditor? #27

Open sytong opened 11 years ago

sytong commented 11 years ago

Hi tsechingho,

I am running into this issue and hope you can provide some insights. I am deploying my rails app as a WAR file in JBoss and the application is deployed under a path, say, /sytong/app.

When I accessed the deployed app, I saw that the .js and .css file path are generated like this (I masked the hostname with '<HOSTNAME>'):

<script type="text/javascript" src="http://<HOSTNAME>/assets/ckeditor/config.js?t=D5AC" style=""></script>

However, to make it work, the path should look like this (note the path /sytong/app before /assets)

<script type="text/javascript" src="http://<HOSTNAME>/sytong/app/assets/ckeditor/config.js?t=D5AC" style=""></script>

I have defined my relative path in production.rb:

config.relative_url_root = "/sytong/app"

I have tried to add this by overriding basepath.js.erb as you have mentioned in the README but I don't think my basepath.js.erb was actually used.

Would you have any suggestion for me in this case? Thanks.

saravananNV commented 11 years ago

Do you getting browser dialog box on the ckeditor for uploading image from local system.if u get that can u tell me plz. i am newbe to ruby

sytong commented 11 years ago

saravananNV, I suggest you look for information about this feature in the CKEditor community or you can search around in StackOverflow. For starter, try this: http://stackoverflow.com/questions/2115302/ckeditor-image-upload-filebrowseruploadurl

tsechingho commented 11 years ago

@sytong It's about the rails' relative_url_root mechanism. You might take a look:

saravananNV commented 11 years ago

thank u