Rails ckeditor changes reflects in Dev but not in prod - ruby-on-rails

I have been working on a project where i had integrated CKeditor as the default editor for blogging. Later on i added the functionality to add Youtube links for which I had to create the following folders
app/assets/javascripts/
mkdir ckeditor/plugins
touch config.js
Now I have installed markdown and youtube in config.js
These changes are being reflected perfectly in development mode
Once deployed in Heroku the changes are not being displayed.
Here is my production.rb related changes:
Please help
config.assets.compile = true
config.assets.precompile += Ckeditor.assets
#config.assets.precompile += [ /._ckeditor.js/, /._config.js/, /._cs.js/, /._editor.css/, /._plugin.js/, /._en.js/, /._contents.css/, /._default.js/ ]
config.assets.precompile += %w(ckeditor/* )
config.autoload_paths += %W(#{config.root}/app/models/ckeditor)

Related

Custom icons and Rev Icons (Revolution Slider) not showing in Production

Ruby 2.3.1
Rails 5.1.3
I recently did some local precompile into my production environment using RAILS_ENV=production bin/rails assets:precompile and I see that my revicon fonts and custom fonts successfully precompiles into my public/asset folder. When I run my server through WEBrick, I get the famous square character instead of the one that should show. In development it shows the icons with no problem but when I inspect on google chrome dev tools, it shows a GET error on ttf and woff files for both revicons and custom icons. After doing some research I found that under assets.rb, I can add:
Rails.application.config.assets.precompile += %w( revolutionslider/fonts/revicons/revicons.woff )
Rails.application.config.assets.precompile += %w( revolutionslider/fonts/revicons/revicons.ttf )
But unfortunately it did not work.
So I tried another solution and it was to switch config.assets.compile = false to true. It successfully load the assets with no problem but I read that it impacts the load time on your page. Is there any other solution or way to load all the assets without switching config.assets.compile = false to true?
Would appreciate any suggestion. Thanks!

Refinerycms 2.1.0 assets not loading property on Heroku

I'm trying to deploy a refinerycms app into Heroku. the deployment process goes smoothly but assets are not loading properly in front-end and back-end (see image attached).
1 - I have compiled my assets.
2 - I set config.assets.initialize_on_precompile = false
3 - Commited my changes.
and still have the same issue.
What am I missing?
Try adding any refinerycms assets you are missing to config.assets.precompile in production.rb file.
i.e.
config.assets.precompile += ['refinery/refinery.css']

Rails stylesheets placed in assets don't show on website

I have a set of custom stylesheets in assets/stylesheets/xxx folder.
I have a custom application_xxx.css.scss file in assets/ that requires all of those.
I have a custom layout xxx_application.html.haml which includes:
= stylesheet_link_tag 'application_xxx'
Everything works nicely in development, when I push everything now to the testing server none of the stylesheets are working. it gives a msg "Failed to load resource application_xxx.css "
Do I have to place my custom folder and custom application file in the public directory instead?
Have you precompiled assets?
bundle exec rake assets:precompile
You don't need to manually move any any custom css or js. Precompile your assets then try pushing again.
My production.rb file has these relevant lines:
config.assets.precompile += %w( application-all.css application-print.css )
config.assets.compile = false
config.serve_static_assets = false

Including assets in subdirectories with config.assets.precompile in Rails

I've got a Rails 3.1.3 application running on Heroku, utilizing S3 for asset hosting via asset_sync. Included in my app/assets/css directory is a subdirectory with two files: main.css.scss and categories.css.scss. I have the following line in my production.rb:
config.assets.precompile += [ 'admin/main.css.scss', 'admin/categories.css.scss', 'print.css', 'products.css.scss', 'services.css.scss' ]
When I push to Heroku, all my assets are precompiled and uploaded with the exception of those two files. Do I need to perform some sort of dark magic to include those two files in the process?
Just type the filenames without scss and it will work fine.
config.assets.precompile += [ 'admin/main.css', 'admin/categories.css', 'print.css', 'products.css', 'services.css' ]

Heroku not displaying (finding?) .css and .js files

I have recently added a project to Heroku. However, none of the .css files or .js files seem to be working.
I am using Twitter's Bootstrap .css and .js files. I have added the files to their respective directories in vendor/assets.
Based on other questions I have seen asked here I upgraded from Bamboo to Cedar on Heroku. I also tried rake assets:precompile RAILS_ENV=production, changing config.assets.enabled = true to config.assets.enabled = false in application.rb, config.assets.compile = false config.assets.compile = true in production.rb, and about as many combinations of the above things as I could think of.
Everything is working fine locally.
(Adding a link to the github in an attempt to provide more information.)
https://github.com/moctopus/sixtydays
By default assets:precompile won't process the css/js files in /vendor/assets. In production.rb you can use config.assets.precompile to get additional css/js files processed by the asset precompile.
For example, if you had your twitter bootstrap css/js files inside /vendor/assets/bootstrap use:
config.assets.precompile += %w[ bootstrap/*.css bootstrap/*.js ]
Then rake assets:precompile will process them and they'll work on heroku.
see: http://guides.rubyonrails.org/asset_pipeline.html#precompiling-assets
The default matcher for compiling files includes application.js,
application.css and all non-JS/CSS files

Resources