Created
April 17, 2013 23:55
-
-
Save jessabean/5408752 to your computer and use it in GitHub Desktop.
Example of inserting javascript specific to a page or resource
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!! | |
%html{:lang => "en", :xhmns => "http://www.w3.org/1999/xhtml", "xml:lang" => "en"} | |
%head | |
%title= full_title(yield(:title)) | |
%meta{:content => "width=device-width, initial-scale=1.0", :name => "viewport"} | |
= stylesheet_link_tag "application", "http://fonts.googleapis.com/css?family=Questrial|Damion" | |
= javascript_include_tag "https://js.stripe.com/v1/", "application" | |
= csrf_meta_tags | |
= tag :meta, :name => "stripe-key", :content => STRIPE_PUBLIC_KEY | |
%body | |
= render :partial => "shared/navbar" | |
#content.container | |
= render :partial => "shared/sub_menu", :locals => {:categories => @categories} | |
= render :partial => "shared/flash_messages", :locals => {:flash => flash} | |
= yield | |
= render :partial => "shared/footer" | |
= yield(:javascripts) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/ %h1= current_store.name | |
%ul.breadcrumb | |
%li | |
%span.divider | |
/ | |
%li.active | |
All Products | |
.row-fluid | |
.thumbnails.product_list | |
- @products.each_with_index do |product, index| | |
- if product.active | |
%li.span3 | |
.thumbnail{id: "thumbnail-#{index}"} | |
= link_to product_path(product.store, product) do | |
= image_tag product.photo.url | |
%div{class: "cart-hidden-#{index}"} | |
= button_to "Add to Cart", line_items_path(:store_id => current_store, :product_id => product), :class => "form-primary-button" | |
.caption | |
%h5= link_to product.title, product_path(product.store, product) | |
%p= number_to_currency(product.price_in_dollars) | |
/ = paginate @products | |
= javascript_include_tag "products" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment