Open jeremylynch opened 10 years ago
I found a temporary solution by determining the controller from the url path all with jquery. Once the controller is determined,
function Getcontroller() {
var controller = window.location.pathname.split('/')[1];
return controller
}
$(document).ready(function() {
controller = Getcontroller()
if (controller == 'users') {
config_1()
} else {
config_2()
}
});
function config_1() {
redactor config_1 here
}
function config_2() {
redactor config_2 here
}
How can I use two different configs in one Controller? For example, one for post, and another for comment.
untested, but could you not have a different class identifying the textarea and two different JS calls to redactor them:
$('.redactor-simple').redactor(
{
buttons: [ 'formatting', 'bold', 'italic', 'unorderedlist','orderedlist','link','underline']
}
);
$('.redactor-really-simple').redactor(
{
buttons: [ 'underline']
}
);
I want to implement two versions of the Redactor text-editor in my rails app with different config files. How can this be achieved?