Application.html.haml文件未呈现
问题描述:
我是ROR的新手。我正在使用erb文件的项目,现在我已经将它们转换为haml。Application.html.haml文件未呈现
我已经安装了哈姆宝石正如其他帖子中提到的,但没有运气! 并使用导轨4.
问题是这个application.haml文件没有呈现我不知道为什么。 请帮助 请让我知道如果任何其他信息需要 这里是application.html.haml
!!!
%html
%head
%title PipeCast
%link{:rel => "stylesheet", :href => "assets/stylesheets/application.css"}
= csrf_meta_tags
= render 'layouts/shim'
%body
= render 'layouts/header'
= yield
这里是application_controller.rb
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
# protect_from_forgery with: :null_session
# before_filter :set_cache_buster
#
# def set_cache_buster
# response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate"
# response.headers["Pragma"] = "no-cache"
# response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
# end
#
end
这页控制器扩展应用程序控制器,但其没有渲染应用程序布局
个class PagesController < ApplicationController
def home
@greeting = "Hello Welcome to Ruby Web Application"
end
end
Server日志你可以尽管所有文件都是HAML这里需要注意的却是呈现页/ home.html.erb不知道从那里!
=> Rails 4.1.1 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
=> Ctrl-C to shutdown server
[2014-11-23 01:13:29] INFO WEBrick 1.3.1
[2014-11-23 01:13:29] INFO ruby 2.1.0 (2013-12-25) [x86_64-darwin14.0]
[2014-11-23 01:13:29] INFO WEBrick::HTTPServer#start: pid=20082 port=3000
Started GET "/" for 127.0.0.1 at 2014-11-23 01:35:39 +0530
Processing by PagesController#home as HTML
Rendered pages/home.html.erb (15.2ms)
Completed 200 OK in 79ms (Views: 53.9ms | ActiveRecord: 0.0ms)
Started GET "/" for 127.0.0.1 at 2014-11-23 01:36:27 +0530
Processing by PagesController#home as HTML
Rendered pages/home.html.erb (0.1ms)
Completed 200 OK in 3ms (Views: 2.9ms | ActiveRecord: 0.0ms)
Started GET "/" for 127.0.0.1 at 2014-11-23 01:36:27 +0530
Processing by PagesController#home as HTML
Rendered pages/home.html.erb (0.1ms)
Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms)
Started GET "/" for 127.0.0.1 at 2014-11-23 01:36:28 +0530
Processing by PagesController#home as HTML
Rendered pages/home.html.erb (0.1ms)
Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)
先在'%body'标记下移动'= render'layouts/shim''。 – 2014-11-22 18:34:35
我做了你说的,但没有运气! – Vishal 2014-11-22 18:37:00
你有没有其他'layouts'? – 2014-11-22 18:38:10