好吧,我不知道我在做什麼。我沒有關於前端的技能。Rails bootstrap
我想使用引導進行下拉菜單。 我得到了示例代碼,但菜單不工作... 我很確定我有一個缺少的寶石,或缺少包括在一些CSS或JS文件。
的Rails 4.2.0
紅寶石2.2.0
aplication.css:
*= require_self
*= require_tree .
*= require flat-ui
*/
bootstrap_and_overrides.css
/*
=require twitter-bootstrap-static/bootstrap
Use Font Awesome icons (default)
To use Glyphicons sprites instead of Font Awesome, replace with "require twitter-bootstrap-static/sprites"
=require twitter-bootstrap-static/fontawesome
*/
的Gemfile
gem 'sass-rails', '~> 4.0.0'
gem 'jquery-rails'
gem "twitter-bootstrap-rails"
gem 'flatui-rails'
# Turbolinks gem is commented
的application.js
//= require jquery
//= require jquery_ujs
//= require twitter/bootstrap
//= require flat-ui
application.html.erb
<div class="navbar navbar-fluid-top">
<div class="navbar-inner">
<div class="container-fluid">
<a class="btn btn-navbar" data-target=".nav-collapse" data-toggle="collapse">
<span class="ic on-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href=<%=displays_path%>>Visualizeitor</a>
<div class="container-fluid nav-collapse">
<ul class="nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">Separated link</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">One more separated link</a></li>
</ul>
</li>
<li><%= link_to "majors", majors_path %></li>
<li><%= link_to "students", students_path %></li>
<li><%= link_to "courses", courses_path %></li>
<li><%= link_to "teachers", teachers_path %></li>
<li><%= link_to "students", students_path %></li>
</ul>
<ul class="nav pull-right">
<% if teacher_signed_in? %>
<li><%= link_to 'Edit profile', edit_teacher_registration_path, :class => 'navbar-link' %></li>
<li><%= link_to "Logout", destroy_teacher_session_path, method: :delete, :class => 'navbar-link' %></li>
<% elsif student_signed_in? %>
<li><%= link_to 'Edit profile', edit_student_registration_path, :class => 'navbar-link' %></li>
<li><%= link_to "Logout", destroy_student_session_path, method: :delete, :class => 'navbar-link' %></li>
<% else %>
<li><%= link_to "Login - teacher", new_teacher_session_path, :class => 'navbar-link' %></li>
<li><%= link_to "Login - student", new_student_session_path, :class => 'navbar-link' %></li>
<% end %>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
如何使我的下拉工作?
$()。modal返回函數$ .fn.modal()...所以,它是? – Techmago
然後你的引導被包括在內。右鍵單擊該頁面上的任何內容,單擊檢查元素,然後插入與我剛剛向您展示的班級的div。該按鈕應該是樣式的。如果是的話,你是一切都很好,並在業務中,現在只是閱讀引導組件頁面:) – Kirka121
是的,它得到了適當的風格....但下降,仍然沒有合作XD – Techmago