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
<html> | |
<head> | |
<title>test</title> | |
</head> | |
<body> | |
<h1>testing gist</h1> | |
<script src="http://gist.github.com/3806.js"></script> | |
</body> | |
</html> |
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
Inflector.inflections do |inflect| | |
inflect.plural 'still life' | |
inflect.singular 'still lives' | |
end |
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
<select name="product[tag_ids][]"> | |
<option></option> | |
<%= options_from_collection_for_select(tag.children, "id", "name") %> | |
</select> |
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
def add_to_cart | |
@cart = find_cart | |
product = Product.find(params[:id]) | |
quantity = params[:quantity] | |
quantity ||= 1 | |
if quantity.to_i > product.quantity.to_i | |
logger.info "This product only has #{product.quantity.to_i} remaining." | |
render :nothing => true, :status => 400 and return | |
else |
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
@data={:last_order_list_view=>"All", :order_id=>nil, :cart=>#<Cart:0x250c27c @items=[#<OrderLineItem id: nil, item_id: 2, order_id: 0, quantity: 1, unit_price: 95.0, name: "test">], @shipping_cost=0.0, @tax=0.0, @total=0.0>, :user=>1, :return_to=>nil, :product_id=>"2", "flash"=>{}} |
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
# My sample caconfig.cnf file. | |
# | |
# Default configuration to use when one is not provided on the command line. | |
# | |
[ ca ] | |
default_ca = local_ca | |
# | |
# | |
# Default location of directories and files needed to generate certificates. | |
# |
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
Filter chain halted as [#<ActionController::Filters::ClassMethods::SymbolFilter:0x2aaaaec955f8 @filter=:ssl_required>] rendered_or_redirected. |
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
<% if @order_account.cc_type %> | |
<% @selected = @order_account.cc_type %> | |
<% end %> | |
<td><%= select('order_account', 'cc_type', OrderAccount.cc_type, {:selected => @selected}, {:tabindex => "9"}) %> |
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
def run_transaction_paypal_wpp(remote_ip) | |
ba = self.billing_address | |
logger.info ("\n\n\n\n Before credit_card:#{self.account.cc_type} \n\n\n\n") | |
credit_card = ActiveMerchant::Billing::CreditCard.new( | |
:type => self.account.cc_type.to_s, | |
:number => self.account.cc_number, | |
:month => self.account.expiration_month, | |
:year => self.account.expiration_year, | |
:first_name => ba.first_name, | |
:last_name => ba.last_name |
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
Product.find_by_category(category_id, ????, "display_on ASC") |
OlderNewer