SammyLin/redactor-rails

Buttons cannot be shown by following the instruction

Closed this issue · 3 comments

The result after added:
1

  • app/assets/javascripts/application.js:

    //= require redactor-rails
    //= require /redactor-rails/langs/zh_cn
    //= require /redactor-rails/plugins
    
  • app/assets/stylesheets/application.css.scss:

    /*
    *= require_self
    *= require_tree .
    *= require redactor-rails
    *= require redactor-rails/plugins
    */
    
  • app/views/layouts/application.html.erb (I change text_area_tag to text_area):
    <%= text_area :editor, "", :class => "redactor", :rows => 40, :cols => 120 %\>

  • app/assets/javascripts/redactor-rails/config.js:

    $(document).ready(
    function(){
     var csrf_token = $('meta[name=csrf-token]').attr('content');
     var csrf_param = $('meta[name=csrf-param]').attr('content');
     var b1 = ["html", "|", "formatting", "|", "bold", "italic", "underline", "deleted", "|", "unorderedlist", "orderedlist",  "outdent", "indent", "|", "image", "video", "file", "link", "table", "|", "fontcolor", "backcolor", "|", "alignment", "|", "h orizontalrule"];
     var b2 = [ 'bold', 'italic', 'underline', 'formatting', 'image', 'link', 'unorderedlist', 'orderedlist', 'alignment', '|' , 'html' ];
     var params;
     if (csrf_param !== undefined && csrf_token !== undefined) {
       params = csrf_param + "=" + encodeURIComponent(csrf_token);
     }
    
     $('.redactor').redactor(
       { "imageUpload":"/redactor_rails/pictures?" + params,
         "imageGetJson":"/redactor_rails/pictures",
         "fileUpload":"/redactor_rails/documents?" + params,
         "fileGetJson":"/redactor_rails/documents",
         "path":"/assets/redactor-rails",
         "css":"style.css",
         "lang": "zh_cn",
         "plugins": ["fullscreen"],
         "fixed": true,
         "toolbarFixedBox: true,
         "buttons": b2
       }
     );
    });
    

Okay, I found the problem is zh_cn.js, there missing a comma.

already pull requests and updated gem version 0.4.3

Thanks!
After verification, this bug has been fixed.