Code Monkey home page Code Monkey logo

Comments (3)

julitrows avatar julitrows commented on August 25, 2024

Also, although the generated code reflects the :cols value, the cols value in the html textarea wrapper generated is set always to 40, no matter the cols value passed in the view. This way, having :cols => 10 will result in the same area that :cols => 90.

from ckeditor.

treydock avatar treydock commented on August 25, 2024

I'm having this same issue but defining cols in the input_html isn't fixing it for me.

      <%= f.semantic_fields_for :questions, question do |q| %>
        <%= f.label "question_text", question.text %>
        <%= q.semantic_fields_for "#{question.id}" do |a| %>
          <%= render_question_answers(a, question) %>
          <% if question.has_comment %>
            <%= a.input :comment, :as => :ckeditor, :required => false,
                        :input_html => { :value => "Please add any comments here.", :cols => 10 } %>
          <% end %>
        <% end %>
      <% end %>

Generates this

<li class="ckeditor input optional" id="ballot_questions_62_comment_input"><label class=" label" for="ballot_questions_62_comment">Comment</label><textarea cols="40" id="ballot_questions_62_comment" name="ballot[questions][62][comment]" rows="20"></textarea><script type="text/javascript">
//<![CDATA[
if (CKEDITOR.instances['ballot_questions_62_comment']) {CKEDITOR.remove(CKEDITOR.instances['ballot_questions_62_comment']);}CKEDITOR.replace('ballot_questions_62_comment', { "autofocus": false,"cols": 10,"id": 'ballot_questions_62_comment',"language": 'en',"namespace": ,"required": false,"value": 'Please add any comments here.' });
//]]>
</script>

</li>

With the error...

Uncaught SyntaxError: Unexpected token ,

Looks like "namespace" is missing a value. Any ideas?

from ckeditor.

treydock avatar treydock commented on August 25, 2024

Think my problem was related to #102. Adding :namespace => "" to :input_html solved it.

from ckeditor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.