RoR - 无法在生产中看到顶级菜单栏

时间:2015-05-07 19:53:29

标签: html css ruby-on-rails menu visible

我创建了一个rails应用程序,添加了一个位置固定的顶级菜单栏。它在开发中运行良好,但是当我在线部署它时,我无法看到我的菜单栏。我还使用FontAwesome添加了字形图标,但它也没有显示。

我的production.rb

# Disable serving static files from the `/public` folder by default since
  # Apache or NGINX already handles this.
  config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?

  # Compress JavaScripts and CSS.
  config.assets.js_compressor = :uglifier
  # config.assets.css_compressor = :sass

  # Do not fallback to assets pipeline if a precompiled asset is missed.
  config.serve_static_assets = true
  config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
  config.assets.compile = true

  # Asset digests allow you to set far-future HTTP expiration dates on all assets,
  # yet still be able to expire them through the digest params.
  config.assets.digest = true

我的application.html.haml

!!!
%html
%head
    %title Blogger
    = stylesheet_link_tag    'application', media: 'all'
    = javascript_include_tag 'application'
    %link{:rel => "stylesheet", :href => "http://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.1/normalize.min.css"}
    %link{:rel => "stylesheet", :href => "http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css"}
    = csrf_meta_tags
%body
    %header
        .wrapper.clearfix
            #logo= link_to "Blogger", root_path
            %nav
                - if user_signed_in?
                    = link_to current_user.name, edit_user_registration_path
                    = link_to "Logout", destroy_user_session_path, :method => :delete
                    = link_to "Add New Post", new_post_path, class: "button"
                - else
                    = link_to "Sign in", new_user_session_path
                    = link_to "Sign Up", new_user_registration_path
                    = link_to t('Contact'), new_contact_path
    %p.notice= notice
    %p.alert= alert


    = yield

具体而言,它不会在%header

下加载任何内容

0 个答案:

没有答案