我使用 HAML 作为我的标记语言。我的视图只呈现自我视图,没有布局应用程序。如果我用我的方法写
渲染:布局=>真
我去拿
HomesController 中没有默认布局
/home/pavel/.rvm/gems/ruby-1.9.3-p194/gems/kaminari-0.13.0/app/views]>
但是,如果我将 application.html.haml 重命名为 application.html.erb,一切正常。但是脚手架可以毫无问题地生成 HAML。怎么了?
class HomesController < ApplicationController
def index
@manufacturers = Manufacturer.all
#render :layout => 'application'
end
end
看法
%ul
- @manufacturers.each do |manufacturer|
%li
= link_to manufacturer.MFA_BRAND, vehiclemodel_url(:id => manufacturer.MFA_ID)
布局
!!!
%html
%head
%title Title
= stylesheet_link_tag "application"
= javascript_include_tag "application"
= csrf_meta_tags
%body
- if current_user
= "Signed in as #{current_user.email}. Not you?"
= link_to "Sign out", logout_path
- else
= link_to "Sign in", new_user_session_path
%p
Hello!
%h4
=yield