Guest

Untitled

By: a guest on Jan 28th, 2012  |  syntax: None  |  size: 0.62 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. def create
  2.     @option_type = OptionType.new(params[:option_type])
  3.     @product = Product.find_by_param!(params[:product_id])
  4.     if @option_type.save
  5.       respond_to do |format|
  6.         format.html {
  7.           redirect_to admin_option_types_url}
  8.       end
  9.     end
  10.   end
  11.  
  12. # should be
  13.  
  14.   def create
  15.     @option_type = OptionType.new(params[:option_type])
  16.     @product = Product.find_by_param!(params[:product_id])
  17.     respond_to do |format|
  18.       if @option_type.save
  19.         format.html {redirect_to admin_option_types_url}
  20.       else
  21.         format.html { render :action => "new" }
  22.       end
  23.     end
  24.   end