Skip to content
Browse files

Implemented HAML and a first view refactoring

  • Loading branch information...
1 parent a35b912 commit dba18219106b55e14027815dbf2d39e8437b7b2c @jcasimir committed Apr 22, 2011
Showing with 17 additions and 18 deletions.
  1. +1 −0 Gemfile
  2. +2 −0 Gemfile.lock
  3. +0 −18 app/views/companies/index.html.erb
  4. +14 −0 app/views/companies/index.html.haml
View
1 Gemfile
@@ -2,6 +2,7 @@ source 'http://rubygems.org'
gem 'rails', '3.0.6'
gem 'sqlite3'
+gem 'haml'
group :development, :test do
gem 'rspec-rails'
View
2 Gemfile.lock
@@ -52,6 +52,7 @@ GEM
abstract (>= 1.0.0)
ffi (1.0.7)
rake (>= 0.8.7)
+ haml (3.0.25)
heroku (1.20.1)
launchy (~> 0.3.2)
rest-client (>= 1.4.0, < 1.7.0)
@@ -131,6 +132,7 @@ PLATFORMS
DEPENDENCIES
autotest
capybara
+ haml
heroku
jquery-rails
mocha
View
18 app/views/companies/index.html.erb
@@ -1,18 +0,0 @@
-<% title "Companies" %>
-
-<div class="companies">
- <% @companies.each do |company| %>
- <div class="company">
- <h4><%= company.name %></h4>
- <%= render :partial => 'email_addresses/email_addresses', :object => company.email_addresses %>
- <%= render :partial => 'phone_numbers/phone_numbers', :object => company.phone_numbers %>
- <ul class="actions">
- <%= link_to "Show", company %>
- <%= link_to "Edit", edit_company_path(company) %>
- <%= link_to "Destroy", company, :confirm => 'Are you sure?', :method => :delete %>
- </ul>
- </div>
- <% end %>
-</div>
-
-<p><%= link_to "New Company", new_company_path %></p>
View
14 app/views/companies/index.html.haml
@@ -0,0 +1,14 @@
+- title "Companies"
+
+%div.companies
+ - @companies.each do |company|
+ div.company
+ %h4= company.name
+ = render :partial => 'email_addresses/email_addresses', :object => company.email_addresses
+ = render :partial => 'phone_numbers/phone_numbers', :object => company.phone_numbers
+ %ul.actions
+ = link_to "Show", company
+ = link_to "Edit", edit_company_path(company)
+ = link_to "Destroy", company, :confirm => 'Are you sure?', :method => :delete
+
+%p= link_to "New Company", new_company_path

0 comments on commit dba1821

Please sign in to comment.
Something went wrong with that request. Please try again.