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

How to support rails 4 asset pipeline #104

Open
jerryshen opened this issue Dec 4, 2013 · 8 comments
Open

How to support rails 4 asset pipeline #104

jerryshen opened this issue Dec 4, 2013 · 8 comments

Comments

@jerryshen
Copy link

not working on production mode.

@ChrisSki
Copy link

Are their any plans for this? I didn't use this gem because I have a rails 4 app deployed and I can't seem to get it working properly on Heroku. Looks like the paths are wrong. Seems like this gem has that figured out.

Note: I'm also using active admin

@izakfilmalter
Copy link

This was a huge pain in the butt. Here's my solution:

In your application css file add:

@import "redactor-rails"

Note, I'm using sass so for a regular css file it will be different.

Then within you application.rb make sure that you compile the assets in the proper order. Mainly have redactor compile first.

config.assets.precompile += ['redactor-rails/*', 'print.css', 'cocoon.js', 'admin.css', 'admin.js', 'application.css', 'application.js']

Finally run:

rake assets:precompile --trace

I use trace as a just in case.

Then deploy to heroku or what ever.

Now that you have the solution let me explain why this works. Redactors assets will not be added into the precompiled css files if it is not compiled before they are. Also they are not compiling in the heroku push properly, I'm using a custom deploy strat so it may be different for y'all. Remember to precompile before heroku push.

@wilgoszpl
Copy link
Collaborator

I'll work on that soon.

@activestylus
Copy link

+1

Thanks for the temporary fix izakfilmalter

@arun057
Copy link

arun057 commented Apr 28, 2015

+1

Thanks for the temp fix izakfilmalter

@jaymiejones86
Copy link

+1

1 similar comment
@antonpaisov
Copy link

👍

@toxis
Copy link

toxis commented Oct 18, 2015

For Rails 4.x in production and with a custom config, I have to replace this line in application.js:

//= require redactor-rails

By these lines:

//= require redactor-rails/redactor
//= require redactor-rails/config

To explicitly say use my own config.js and not the default config.

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

No branches or pull requests

9 participants