Closed davidkennedy-examtime closed 12 years ago
Aha, more information. If I go into my config/production.rb
file, and edit the following setting, I am presented with a working set of pages; this is a possible workaround.
# Disable Rails's static asset server (Apache or nginx will already do this)
# OVERRIDDEN DEFAULT: set to 'true' to workaround TinyMCE issue?
config.serve_static_assets = true
However, I really do not want to have this set to 'true' in production if at all possible; it seems like a bad idea for scalability.
Also, I'm confused about why this is a workaround; I can see that there was a TinyMCE related JavaScript line in the header asking to GET the asset editor_template.js
, but why wasn't this already precompiled and pulled into a header, ie, the JS functions are already loaded, why ask for them (I think)?
If you're running Apache, nginx or similar in your production environment, those assets will be accessible. Thin doesn't server static assets without the help of the static assets middleware. It is definitely better to have the static assets served by the web server if possible.
Also, I'm confused about why this is a workaround; I can see that there was a TinyMCE related JavaScript line in the header asking to GET the asset editor_template.js, but why wasn't this already precompiled and pulled into a header, ie, the JS functions are already loaded, why ask for them (I think)?
Whilst the main TinyMCE script can be precompiled into application.js
, TinyMCE loads the majority of its themes, plugins, etc at runtime. This obviously isn't ideal for the asset pipeline, hence the workarounds in this gem.
My apologies, you're right. My inexperience with Rails is showing. In a real production environment (EngineYard), everything is working fine, it's only in our production-on-a-laptop staging environment that the issue occured. Completely obvious once it's pointed out!
Thanks.
In development mode, TinyMCE is working great, but in production mode, I seem unable to load precompiled TinyMCE assets. However, the assets are in my public/assets directory as expected. The page with the TinyMCE textareas does not render any textareas.
Detail: Command and logs:
I am unclear if this is a routing issue on my part, but I don't see anything in the documentation about needing to tweak
config/routes
Integration: as per instructions: Gem installed via bundler, in my
app/assets/javascripts/application.js
I haveOn each page I require a page specific
manifest.js
which includes several files, including one with the TinyMCE javascript hook customised for my preferred buttons etc; I can see thismanifest.js
in mypublic/assets
.Versions: I'm using Rails 3.1.0, and Ruby 1.9.3. I've cleared out all gemsets etc, and have tried building the
tinymce-rails
Gem directly from GitHub.Any advice?