# This example does an AJAX lookup and is in CoffeeScript
$('.typeahead').typeahead(
# source can be a function
source: (typeahead, query) ->
# this function receives the typeahead object and the query string
# This example does an AJAX lookup and is in CoffeeScript
$('.typeahead').typeahead(
# source can be a function
source: (typeahead, query) ->
# this function receives the typeahead object and the query string
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
- if asset_exists? "#{params[:controller]}.css" | |
= stylesheet_link_tag params[:controller] | |
- if asset_exists? "#{params[:controller]}.js" | |
= javascript_include_tag params[:controller] |
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
# Add to the bottom of your application.rb file: | |
require 'digest/md5' |
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
def setup_components | |
response = HTTParty.post("#{Chargify.site}/product_families/#{[product_family_id]}/quantity_based_components.json", | |
:body => component_attributes.as_json, | |
:basic_auth => {:username => Chargify.api_key, :password => 'X'}) | |
response.code.should == 201 | |
end | |
def component_attributes | |
{ |
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
rdoc: --inline-source --line-numbers --format=html --template=hanna --main README.rdoc README.rdoc README.md README.textile README.markdown README.txt README |