Ruby on rails 引导的怪异行为
为什么选项卡在rails中不能正常工作?Bootstrap的JavaScript文件加载不正确,还是我做错了什么?我有一个选项卡面板,基本上有两个内容。一个用于提问,另一个用于博客帖子。每当我刷新页面时,博客文章的内部HTML就会与问题面板混合在一起,就好像Bootstap的脚本从未真正“加载” 为了举例说明我的问题,以下是我刷新页面时的图像: 这是我单击其中一个选项卡时的图像。(脚本加载内容,并按我希望的方式分隔内容。) 问题标签: 博客帖子的标签: Application.js代码:Ruby on rails 引导的怪异行为,ruby-on-rails,twitter-bootstrap,Ruby On Rails,Twitter Bootstrap,为什么选项卡在rails中不能正常工作?Bootstrap的JavaScript文件加载不正确,还是我做错了什么?我有一个选项卡面板,基本上有两个内容。一个用于提问,另一个用于博客帖子。每当我刷新页面时,博客文章的内部HTML就会与问题面板混合在一起,就好像Bootstap的脚本从未真正“加载” 为了举例说明我的问题,以下是我刷新页面时的图像: 这是我单击其中一个选项卡时的图像。(脚本加载内容,并按我希望的方式分隔内容。) 问题标签: 博客帖子的标签: Application.js代码:
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
//= require jquery_ujs
//= require bootstrap-sprockets
//= require turbolinks
//= require_tree .
面板代码:
<div class="well">
<ul class="nav nav-tabs">
<li role="presentation"><a class="none white" href="#questions" aria-controls="questions" role="tab" data-toggle="tab">Questions</a></li>
<li role="presentation"><a class="none white" href="#posts" aria-controls="posts" role="tab" data-toggle="tab">Blog posts</a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="questions">
<br>
<% @user.questions.each do |question| %>
<%= link_to question.title, question_path(question), :class => "ques" %>
<p class="pull-right">
<%= question.user.username %>
</p>
<hr/>
<% end %>
</div>
<div role="tabpanel" class="tab-pane active" id="posts">
<br>
<p><a href="#" class="ques">test blog post 123 123</a></p>
<p><a href="#" class="ques">test blog post 123 123</a></p>
<p><a href="#" class="ques">test blog post 123 123</a></p>
<p><a href="#" class="ques">test blog post 123 123</a></p>
</div>
</div>
</div>
“ques”%>
显然,我在两个面板上都错误地添加了活动类。因此,通过删除第二个类,一切都得到了修复。我将首先去掉
和
标记-改用CSS。是否查看日志以查看是否正在加载引导?我们不可能在这里检查这个来回答你的问题。我不能。我需要等两天。