0

我需要知道如何在 adminlte2-rails gem 中定义可用的 AdminLTE 选项。当我在没有 gem 的情况下将模板放入我的项目时,我发现 js 文件选项很容易,但缺少 gem。请有人帮助我。

4

1 回答 1

-1

这是我的application.html.erb

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <title>APP NAME</title>

    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">

    <!-- YOU NEED TO PUT AdminLTE.css INTO YOUR app/assets/stylesheets/ -->
    <%= stylesheet_link_tag 'application', media: 'screen', 'data-turbolinks-track' => false %>

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

    <%= csrf_meta_tags %>
</head>

<body class="hold-transitio sidebar-mini skin-blue">
<div class="wrapper">

    <header class="main-header">
        // SITE HEADER
    </header>

    <aside class="main-sidebar">
        // SITE SIDEBAR
    </aside>

    <div class="content-wrapper">
        <section class="content-header">
           // PAGE HEADER 
        </section>

        <section class="content">
            <p id="notice"><%= notice %></p>
            <%= yield %>
        </section>
    </div>

    <footer class="main-footer">
       // SITE FOOTER
    </footer>
</div>

<%= javascript_include_tag 'application', 'data-turbolinks-track' => false %>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

<!-- YOU NEED TO PUT AdminLTE.js INTO YOUR app/assets/javascripts/ , 
     AND CONFIG config/initializers/assets.rb WITH:
     Rails.application.config.assets.precompile += %w( AdminLTE.js ) -->
<%= javascript_include_tag 'AdminLTE', 'data-turbolinks-track' => false %>

</body>
</html>

===下面的旧答案===


或者你可以看看这个: https ://almsaeedstudio.com/themes/AdminLTE/documentation/index.html#implementations

https://github.com/nicolas-besnard/adminlte2-rails
https://github.com/racketlogger/lte-rails

我按照此页面源设置 CDN: https ://almsaeedstudio.com/themes/AdminLTE/starter.html


这是我从 starter.html 中得到的确切信息:

  <!-- Bootstrap 3.3.6 -->
  <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">

  <!-- Font Awesome -->
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">

  <!-- Ionicons -->
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">

  <!-- Theme style --> <!-- get these files from AdminLTE repo -->
  <link rel="stylesheet" href="dist/css/AdminLTE.min.css">
  <link rel="stylesheet" href="dist/css/skins/skin-blue.min.css">

对于 JS:

<!-- jQuery 2.2.3 -->
<script src="plugins/jQuery/jquery-2.2.3.min.js"></script>

<!-- Bootstrap 3.3.6 -->
<script src="bootstrap/js/bootstrap.min.js"></script>

<!-- AdminLTE App --> <!-- get it from AdminLTE repo -->
<script src="dist/js/app.min.js"></script>
于 2016-10-21T04:13:07.057 回答