This file contains 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
- base_url = "http://#{request.host_with_port}" | |
!!! XML | |
%urlset{:xmlns => "http://www.sitemaps.org/schemas/sitemap/0.9"} | |
- @pages_to_visit.each do |page| | |
%url | |
%loc #{base_url}#{page[:url]} | |
- if page[:updated_at].present? | |
%lastmod= page[:updated_at] | |
%changefreq= page[:changefreq].present? ? page[:changefreq] : "monthly" | |
%priority= page[:priority].present? ? page[:priority] : "0.5" |
This file contains 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
Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id | |
######### _stars.html.erb ################### | |
<div id="starRating"> | |
<%= form_for(rating_ballot, :html => { :class => 'rating_ballot' }) do |f| %> | |
<%= f.label("value_1", content_tag(:span, '1'), {:class=>"rating", :id=>"1"}) %> | |
<%= radio_button_tag("rating[value]", 1, current_user_rating == 1, :class => 'rating_button') %> | |
<%= f.label("value_2", content_tag(:span, '2'), {:class=>"rating", :id=>"2"}) %> | |
<%= radio_button_tag("rating[value]", 2, current_user_rating == 2, :class => 'rating_button') %> |
This file contains 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
Gist Outline: | |
(1) fablemaker partial | |
(2) create.js.erb | |
(3) leftsidebar partial (which links to the fablemaker partial) | |
(4) application.js | |
(5) routes | |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<!--[if lt IE 9]> | |
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> | |
<![endif]--> | |
<link href="/assets/application.css?body=1" media="screen" rel="stylesheet" type="text/css" /> | |
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.8/themes/ui-lightness/jquery-ui.css" media="screen" rel="stylesheet" type="text/css" /> | |
<script src="https://js.stripe.com/v1/" type="text/javascript"></script> |
This file contains 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
Four code pages: | |
(1) The Error | |
(2) The Order/form | |
(3) the CoffeeScript | |
(4) The create action in the Orders_Controller | |
___________________________________________________________ | |
The ERROR: | |
Stripe::InvalidRequestError in OrdersController#create |
This file contains 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
<span id="vote_button"> | |
<form action="/punchlines/91/votes" class="button_to" data-remote="true" method="post"><div><input type="submit" value="giggle" /><input name="authenticity_token" type="hidden" value="jy3K2aHMY8dCGzriC4XXmqx3RMqEDaXkJqaMdm7nt2Q=" /></div></form> | |
</span> |
This file contains 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
class CartsController < ApplicationController | |
# GET /carts | |
# GET /carts.xml | |
def index | |
@carts = Cart.all | |
@cart = current_cart | |
respond_to do |format| | |
format.html # index.html.erb | |
format.xml { render :xml => @carts } |