레일 웹 앱에 부트 스트랩을 사용하는 데 몇 시간을 보냈지만 아무 일도하지 않았습니다! 나는 어떤 수업도 부를 수 없다! 심지어 존재하지 않는 것처럼Redmine 플러그인에서 부트 스트랩이 작동하지 않습니다
<div class="center">
<h1>Welcome to the User Database</h1>
</div>
<div class="jumbotron">
<h2>
This is the home page for the User Database.
</h2>
**<%= link_to "Add new entry", new_user_path, class: "btn btn-primary" %>
<%= button_to "Search", users_search_path, class: "button", :method => :get %>**
</div>
<!-- User Image -->
<div class="center">
<%= image_tag('user.jpg', :plugin => 'users') %>
</div>
<!-- Style sheet -->
<% content_for :header_tags do %>
<%= stylesheet_link_tag 'style', :plugin => 'users' %>
<% end %>
공지 굵게 표시된 코드 ...을 LINK_TO 라인이 완전히 부트 스트랩 클래스를 무시 :
여기 내 index.html.erb입니다! button_to 라인 (예, 나는 그것을 업데이트 이후 설치 번들 실행)
이내 Gemfile는 부트 스트랩을 포함 ... 완전히 잘 작동 :
@import "bootstrap-sprockets";
@import "bootstrap";
/* mixins, variables, etc. */
/* universal */
body {
padding-top: 0px;
}
section {
overflow: auto;
}
...
:
는
source 'https://rubygems.org'
if Gem::Version.new(Bundler::VERSION) < Gem::Version.new('1.5.0')
abort "Redmine requires Bundler 1.5.0 or higher (you're using #{Bundler::VERSION}).\nPlease update with 'gem update bundler'."
end
#Trying to get bootstrap...?
gem 'bootstrap-sass', '3.3.6'
gem "rails", "4.2.3"
gem "jquery-rails", "~> 3.1.3"
...
또한, 내 CSS 파일은 가장 확실하게 부트 스트랩을 포함
나는 또한 심지어 내 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 any plugin's vendor/assets/javascripts directory 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. JavaScript code in this file should be added after the last require_* statement.
//
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require bootstrap-sprockets
//= require_tree .
그것을 그냥 작동하지 않습니다! 내가 생각할 수있는 유일한 점은 Redmine을위한 플러그인의 일부로 레일 애플리케이션을 구축하고 있는데, 어떻게 든 모든 것을 망쳐 놓고 있다는 것입니다. 그러나 나는 어떻게 보이지 않습니다!
업데이트 : 시도
이 일을 :
<% content_for :header_tags do %>
<%= stylesheet_link_tag 'application', :plugin => 'users' %>
<% end %>
하지만이 비밀 오류!
ActionController::RoutingError (No route matches [GET] "/plugin_assets/users/stylesheets/bootstrap"):
나는 그 의미를 이해하지 못합니다. 스타일 시트 디렉토리에서 부트 스트랩 파일을 찾는 이유는 무엇입니까 ?? Google은이 오류 메시지에 대해 들어 본 적이 없습니다!
먼저,': plugin => 'users'가 무엇을 하려는지는 확실치 않지만 그것을 제거하십시오. 둘째, 레이아웃 파일에 부트 스트랩의 컨테이너 div를 설정 했습니까? – phillyslick
내 응용 프로그램이 redmine 용 플러그인이기 때문에 해당 행이 필요합니다. 참조하십시오 : http://www.redmine.org/projects/redmine/wiki/Plugin_Tutorial#Improving-the-plugin-views 그리고 나는 모든 레이아웃 파일을 가지고 있지 않습니다. 부트 스트랩의 컨테이너 div가 ....인지 모르겠다. 나는이 물건에 완전한 noobie이다 – ineedahero
아, 참으로. 죄송합니다. 컨테이너 div가 필요하지 않을 수 있습니다. 그러나 여기에서 문서를 확인하십시오. http://getbootstrap.com/css/ 'button_to'는 부트 스트랩 버튼으로 렌더링한다고 말합니까? – phillyslick