Agile Web Development with Rails, Edition 4

Agile Web Development with Rails, Edition 4

99 cleanup 26.1 Active Merchant

26.3 HAML

edit Gemfile
gem 'activemerchant'
gem 'haml', '~> 3.1.1'
bundle install
Using rake (0.9.2.2) 
Using i18n (0.6.0) 
Using multi_json (1.0.3) 
Using activesupport (3.2.0.beta) 
Using builder (3.0.0) 
Using activemodel (3.2.0.beta) 
Using erubis (2.7.0) 
Using journey (1.0.0.20111022124133) 
Using rack (1.3.5) 
Using rack-cache (1.1) 
Using rack-test (0.6.1) 
Using hike (1.2.1) 
Using tilt (1.3.3) 
Using sprockets (2.0.3) 
Using actionpack (3.2.0.beta) 
Using mime-types (1.17.2) 
Using polyglot (0.3.2) 
Using treetop (1.4.10) 
Using mail (2.3.0) 
Using actionmailer (3.2.0.beta) 
Using active_utils (1.0.1) 
Using braintree (2.12.0) 
Using json (1.6.1) 
Using money (3.7.1) 
Using activemerchant (1.18.1) 
Using arel (2.2.1) 
Using tzinfo (0.3.30) 
Using activerecord (3.2.0.beta) 
Using activeresource (3.2.0.beta) 
Using bcrypt-ruby (3.0.1) 
Using bundler (1.0.21) 
Using highline (1.6.2) 
Using net-ssh (2.2.1) 
Using net-scp (1.0.4) 
Using net-sftp (2.0.5) 
Using net-ssh-gateway (1.1.0) 
Using capistrano (2.9.0) 
Using coffee-script-source (1.1.2) 
Using execjs (1.2.9) 
Using coffee-script (2.2.0) 
Using rack-ssl (1.3.2) 
Using rdoc (3.11) 
Using thor (0.14.6) 
Using railties (3.2.0.beta) 
Using coffee-rails (3.2.0.beta) 
Using haml (3.1.3) 
Using jquery-rails (1.0.16) 
Using mysql2 (0.3.7) 
Using rails (3.2.0.beta) 
Using sass (3.1.10) 
Using sass-rails (3.1.1.alpha.0) 
Using sqlite3 (1.3.4) 
Using uglifier (1.0.4) 
Using will_paginate (3.0.2) 
Updating .gem files in vendor/cache
Could not find activesupport-3.2.0.beta.gem for installation
rails runner "require 'haml'"

Restart the server.

cat app/views/store/index.html.erb
<% if notice %>
<p id="notice"><%= notice %></p>
<% end %>
<h1><%= t('.title_html') %></h1>
 
<% @products.each do |product| %>
  <div class="entry">
    <%= image_tag(product.image_url) %>
    <h3><%= product.title %></h3>
    <%= sanitize(product.description) %>
    <div class="price_line">
      <span class="price"><%= number_to_currency(product.price) %></span>
      <%= button_to t('.add_html'), line_items_path(product_id: product),
        remote: true %>
    </div>
  </div>
<% end %>
rm app/views/store/index.html.erb
edit app/views/store/index.html.haml
- if notice
  %p#notice= notice
 
%h1= t('.title_html')
 
- @products.each do |product|
  .entry
    = image_tag(product.image_url)
    %h3= product.title
    = sanitize(product.description)
    .price_line
      %span.price= number_to_currency(product.price)
      = button_to t('.add_html'), line_items_path(product_id: product),
        remote: true
get /

Your Pragmatic Catalog

Cs

CoffeeScript

CoffeeScript is JavaScript done right. It provides all of JavaScript's functionality wrapped in a cleaner, more succinct syntax. In the first book on this exciting new language, CoffeeScript guru Trevor Burnham shows you how to hold onto all the power and flexibility of JavaScript while writing clearer, cleaner, and safer code.

$31.00
Ruby

Programming Ruby 1.9

Ruby is the fastest growing and most exciting dynamic language out there. If you need to get working programs delivered fast, you should add Ruby to your toolbox.

$49.95
Rtp

Rails Test Prescriptions

Rails Test Prescriptions is a comprehensive guide to testing Rails applications, covering Test-Driven Development from both a theoretical perspective (why to test) and from a practical perspective (how to test effectively). It covers the core Rails testing tools and procedures for Rails 2 and Rails 3, and introduces popular add-ons, including Cucumber, Shoulda, Machinist, Mocha, and Rcov.

$34.95

99 cleanup 26.1 Active Merchant