Created
July 22, 2011 14:05
-
-
Save shayfrendt/1099512 to your computer and use it in GitHub Desktop.
Revisions
-
shayfrendt created this gist
Jul 22, 2011 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ class Chargify::SubscriptionsController < ApplicationController def update subscription_ids = params['_json'] #Rails.logger.debug("SUB IDS: #{subscription_ids.inspect}") begin subscription_ids.each do |id| # Process updated subscriptions here Rails.logger.debug("SUB ID: #{id}") end respond_to do |format| format.json { head :ok } end rescue # watch out, this will rescue everything! You may want to be more selective... respond_to do |format| format.json { head :internal_server_error } end end end end # suggested corresponding named route for routes.rb # map.chargify_subscriptions '/chargify/subscriptions/:action.:format', :controller => 'chargify/subscriptions'