0

root をロードすると、ヘッダーが表示され、CSS ファイルが正しくロードされますが、別のページ (つまりlocalhost:3000/videos) に移動すると、shared/headerが表示されず、CSS が壊れています。

同じレイアウトで Rails 3 を使用し、CSS でファイルを共有したところ、正しく表示されました。Rails 4 では、レンダリングと歩留まりに変更は見られません。

ビュー/レイアウト/application.html.haml

!!! 5
%html(lang="en-US")
  %head
    %title MyFLiX4.0
    %meta(charset="UTF-8")
    %meta(name="viewport" content="width=device-width, initial-scale=1.0")
    = csrf_meta_tag
    = stylesheet_link_tag "application"
    = javascript_include_tag "application"
    = yield :head
  %body
    %header
      = render 'shared/header'           # This part does not display in yield
    %section.content.clearfix
      = render 'shared/messages'         # This part does not display in yield
      = yield                            # This part does not load CSS properly
    %footer
      &copy 2013 MyFLiX4.0

次のようなパーシャルがあります:
views/shared/_header.html.haml
views/shared/_messages.html.haml

github: https://github.com/yhagio/myflix4.0/tree/master/app/views

4

1 に答える 1

0

app/controllers/videos_controller.rb の 1 行目は

class VideosController < ApplicationController

いいえ

class VideosController < ActionController::Base
于 2013-10-27T00:14:45.597 に答える