Set global tiny_mce_options
-
Kieran P
Hey Gabriel,
A global tiny mce options setting isn't built in yet. Would be nice to have (will add to the todo), but I'd welcome a patch (with tests) beforehand.
Meanwhile, what I do is set a constant in an initializer with the settings, and reuse that constant on the controllers, which works well.
Regards
Kieran -
Gabriel Sobrinho
Hey Kieran,
Thanks for response. I created a method just overwrite the uses_tiny_mce to get what I want. You can see it here: http://pastie.org/private/audjsylhgew7neo3gvt1ig
I think you create a method to be called on ApplicationController (ie: set_default_tiny_mce_options {}) and merge this options with given options of uses_tiny_mce.
I will write this as soon possible and publish here. If you can do it before, please make it.
Regards
-
Kieran P
- State changed from new to resolved
Thanks for some recent contributors, we now have the ability to set global options in config/tiny_mce.yml. The hierarchy is now as follows: (each one overrides options above it)
- config/tiny_mce.yml (the base file for every tinymce editor on the site)
- Controllers (when you call uses_tiny_mce, you can pass options here for different styles per controller)
- Views (when you call init_tiny_mce_if_needed, you can pass options to this, so you can have different tinymce settings per layout.
This should cover most cases, giving enough flexibility.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.