Skip to content

Instantly share code, notes, and snippets.

@sanaumair
Created March 22, 2012 09:17
Show Gist options
  • Save sanaumair/2157281 to your computer and use it in GitHub Desktop.
Save sanaumair/2157281 to your computer and use it in GitHub Desktop.
def show {
options = {
:item_type => @result_item.item_type,
:manufacturer => @result_item.manufacturer ,
:country_code => @result_item.country_code,
:model => @result_item.model,
:id =>@result_item.id,
}
Rails.logger.debug " ----#{result_item_url(options)}"
Rails.logger.debug "message#{URI.decode(request.url)}"
raise Api::Errors::BadRequest.new 'Bad Request it should be like manufacturer-country_code-model' if URI.decode(request.url).to_s.include?(result_item_url(options).to_s)
#it shud raise error if the the url generated by (result_item_url(options) doesnt match the substring in requested url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment