Rails 5:为什么Summernote看起来没有问题?

时间:2017-11-24 15:26:08

标签: ruby-on-rails summernote

我正在将summernote-rails https://github.com/summernote/summernote-rails添加到项目中。我按照自述文件:安装了宝石:

gem 'summernote-rails', 'current version number'
gem 'bootstrap-sass'     # required

我的application.scss:

 *= require_tree .
 *= require_self
 */

@import "bootstrap-sprockets";
@import "bootstrap";
@import "summernote";

的application.js:

//= require jquery
//= require jquery_ujs
//= require rails-ujs
//= require turbolinks
//= require_tree .
//= require bootstrap
//= require summernote

我已将帖子添加到posts / edit.html.erb:

<script type="text/javascript">
  $(document).ready(function() {
    $('#summernote').summernote();
  });
</script>

页面加载了表单,但它完全没有样式。不是Bootstrap的味道。我哪里出错?

1 个答案:

答案 0 :(得分:0)

是的,这是一个新手的错误。忘了包括:

url = 'https://httpbin.org/redirect-to?url=http%3A%2F%2Fhttpbin.org%2Fpost'
data = {'name': 'Hello'}
while True:
    rep = requests.post(url, data=data, allow_redirects=False)
    if rep.status_code in [301, 302]:
        url = rep.headers.get('location')
        print 'redirect to', url
        continue
    break

print rep.text