Skip to content

Instantly share code, notes, and snippets.

@dangalipo
Created January 2, 2011 06:02
Show Gist options
  • Save dangalipo/762333 to your computer and use it in GitHub Desktop.
Save dangalipo/762333 to your computer and use it in GitHub Desktop.
code
class Manage::Products::SpecificationsController < ManageController
# POST /manage/products/1/specifications
#----------------------------------------------------------------------------
def create
raise 'foo'
# @product = Product.find(params[:product_id])
# @variant = @product.product_variants.find(params[:specification]["specable_id"])
#
# # TODO - needs to be fixed, comes from formtastic in the new form
# if params[:specification][:specification_type].present?
# params[:specification][:specification_type] = nil
# raise params.inspect
# end
#
# if @specification = @variant.specifications.create(params[:specification])
# respond_to do |format|
# notice = "#{t('flash.successfully_created')} #{t('object.specification')}"
# format.html {
# flash[:notice] = notice
# redirect_to edit_manage_product_path(@product)+"#attributes"
# }
# format.json {
# render :json => @specification.to_json
# }
# end
# else
# respond_to do |format|
# error = "#{t('flash.couldnt_create')} #{t('object.specification')}"
# format.html {
# flash[:error] = error
# redirect_to edit_manage_product_path(@product)
# }
# format.json {
# render :text => error
# }
# end
# end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment