Skip to content

Instantly share code, notes, and snippets.

@dwillis
Created January 12, 2010 20:56
Show Gist options
  • Save dwillis/275607 to your computer and use it in GitHub Desktop.
Save dwillis/275607 to your computer and use it in GitHub Desktop.
def votes_date_range
return unless check_format
@version = params[:version]
@format = params[:format]
raise ActiveResource::BadRequest.new("Not available in this version") if @version == 'v2'
....
end
def bad_request(e)
@message = e.message
respond_to do |format|
format.xml { render :file => "svc/400.xml", :status => 400, :content_type => 'application/xml' }
format.json { render :file => "svc/400.json", :status => 400, :content_type => 'application/json' }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment