ryknow/toy_tracker

View on GitHub
views/toy_list.haml

Summary

Maintainability
Test Coverage
.row-fluid
  .span5
    %form{:name => "new-toy", :id => "new-toy", :action => "/toys/#{toy_type}", :method => "post"}
      .well
        .row-fluid
          %label{:for => "name"} Name:
          %input{:class => "input-xxlarge", :type => "text", :id => "name", :name => "name", :style => "height: 37px"}
        .row-fluid
          %label{:for => "description"} Description:
          %textarea{:class => "input-xxlarge", :style => "height: 75px", :id => "description", :name => "description"}
        .row-fluid
          %button{:type => "submit", :class => "btn btn-primary", :id => "add-toy"} Add Toy


  .span6
    %form{:class => "form-search", :action => "/toys/#{toy_type}/toy-search"}
      %input{:type => "text", :class => "input-xlarge search-query", :style => "height: 30px", :name => "search_text"}
      %button{:type => "submit", :class => "btn"} Search
    %table{:class => "table table-striped table-bordered table-hover"}
      %thead
        %th Name
        %th Description
      - toys.each do |toy|
        %tr
          %td= toy[:name]
          %td= toy[:description]