2013-08-01 40 views
0

我使用的是水銀軌寶石,在那裏你可以找到它here。除了params [:value]之外,一切都很好。我在文本末尾不斷收到「br標籤」,我想更新。所以,我的參數看起來像這樣水銀軌寶石問題與價值

Parameters: {"content"=>{"post_title"=>{"type"=>"full", "value"=>"yeah<br>"} 

任何人都可能有一個想法,爲什麼出現這種情況?順便說一句,這裏是我的代碼:

<script> 
    $(window).on('mercury:ready', function() { 
     var link = $('#mercury_iframe').contents().find('#edit_link'); 
     Mercury.saveUrl = "<%= mercury_update_admin_post_path(@post) %>"; 
     link.hide(); 
    }); 


</script> 
<div id="container"> 
    <div><p id="notice"><%= notice %></p></div> 

    <div> 
     <h2><span id="post_title" class="mercury-region" data-type="editable" data-mercury="full"><%= @post.title %></span></h2> 
    </div> 

    <div> 
     <p> 
      <%= @post.date.strftime("%B %d, %Y")%> 
     </p> 
    </div> 

    <div class="post-body"> 
     <div id="post_body" class="mercury-region" data-type="editable" data-mercury="full"> 
      <%= raw simple_format(@post.body) %> 
     </div> 
    </div> 

    <div> 
     <%= link_to 'Edit', "/editor" + request.path, :class => "btn", :id => "edit_link" %> 
     <%= link_to 'Back', admin_posts_path, :class => "btn" %> 
    </div> 
</div> 

謝謝。如果有人能幫忙,我會很高興。

回答

1

嗨,這裏是一些從您的內容中刪除br標籤的文檔,請通過這個。 我希望如果你通過這個網址,你可能會得到一些解決方案。

BR tag issue

在上面的網址,你將有一些選項來disble在最後的BR標籤。

pageEditor = new Mercury.FormPageEditor('form.mercury-form', options); 
pageEditor.document.execCommand('insertBrOnReturn', false, false); 

我希望這有助於。