1. Gemfile に以下を追記
gem 'haml-rails'2. bundle install を実行してコントローラを作成
$ bundle install
$ rails g controller index index
create app/controllers/index_controller.rb
route get "index/index"
invoke haml
create app/views/index
create app/views/index/index.html.haml
invoke test_unit
create test/controllers/index_controller_test.rb
invoke helper
create app/helpers/index_helper.rb
invoke test_unit
create test/helpers/index_helper_test.rb
invoke assets
invoke coffee
create app/assets/javascripts/index.js.coffee
invoke scss
create app/assets/stylesheets/index.css.scss
3. 生成された views/index/index.html.haml ファイルを確認
%h1 Index#index %p Find me in app/views/index/index.html.haml4. index#indexにアクセス
5. RSpec
Gemfile に以下を追記して、同じ要領でした。
gem 'rspec-rails'

No comments:
Post a Comment