Sha256: 3d4bca70392964c733e88a4c00fa2540a6edf631a16896674e5efd1df70ba9ff

Contents?: true

Size: 1.76 KB

Versions: 2

Compression:

Stored size: 1.76 KB

Contents

// sample template for rendering lab info
%script{:id=>"lab_item_template", :type=>"text/x-handlebars-template"}
  %li.lab_info
    .lab_image
      -#%img{:src=>"{{image}}", :width=>'12px'}  
    %div
      .lab_name
        {{lab_name}}
      .address
        {{address_without_comma}}, {{titleize city}}, {{state}}
      .phone
        Tel: {{telephone}}
    .link
      // create your own /labs/select via :post method
      = form_for :lab, :url=>'/select', :method=>'post' do |f|
        %input{ :type=>:hidden, :name => 'id', :value=>"{{id}}" }
        %input{ :type=>:hidden, :name => 'lab_id', :value=>"{{lab_id}}" }
        %input{ :type=>:hidden, :name => 'lab_info[name]', :value=>"{{lab_name}}" }
        %input{ :type=>:hidden, :name => 'lab_info[address]', :value=>"{{address_without_comma}}" }
        %input{ :type=>:hidden, :name => 'lab_info[city]', :value=>"{{titleize city}}" }
        %input{ :type=>:hidden, :name => 'lab_info[state]', :value=>"{{state}}" }
        %input{ :type=>:hidden, :name => 'lab_info[zip]', :value=>"{{zip}}" }
        %input{ :type=>:hidden, :name => 'lab_info[telephone]', :value=>"{{telephone}}" }
        = f.submit 'Select location', :class=>'select_location button'

// map display
#map_canvas_container
  #map_canvas{:style => "width:500px; height:350px"}

// lab list display  .. using ul/li style but you can change that
#lab_list_container{ 'data-labs'=>@lab_data.to_json }
  %ul#lab_list

// form for ajax lab searches ..the code to handle return data is in show_labs.coffee
= form_tag(medivo.data_labs_path, :method=>:get, :id=>'lab_data_search', :remote=>true) do
  %div
    Enter a new Zip Code
  .error_message
     
  = text_field_tag :zip_code, params[:zip_code]
  %p
    = submit_tag "Search", :id=> :find_labs, :class=>'button'

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
medivo-0.0.4 spec/dummy/app/views/labs/search.html.haml
medivo-0.0.3 spec/dummy/app/views/labs/search.html.haml