arailsdemo 1

生成项目

rails new arailsdemo

设置 Gemfile

添加:

gem 'haml-rails'
gem 'compass-rails'

安装 bundle 并执行 compass

bundle
``` ruby
bundle exec compass init

更改 layouts/application.html.erb 为 layouts/application.html.haml

%html(lang="en")
%html(lang="en")
  %head
    %meta(charset="utf-8")
    %title aRailsDemo
    %meta(name="description" content="An example Ruby on Rails website.")
    %meta(name="keywords" content="rails, ruby, ruby on rails, demo, example, tutorial, programming")

    = stylesheet_link_tag 'screen.css', :media => 'screen, projection'
    = stylesheet_link_tag 'print.css', :media => 'print'
    /[if IE 8]
      = stylesheet_link_tag 'ie.css', :media => 'screen, projection'

    = stylesheet_link_tag 'scaffold'
    = javascript_include_tag :defaults
    = csrf_meta_tag

  %body
    #container
      #header

      #content        
        = yield

      #sidebar

你可能感兴趣的:(arailsdemo 1)