
Untitled
By: a guest on Jan 28th, 2012 | syntax:
None | size: 0.62 KB | hits: 11 | expires: Never
def create
@option_type = OptionType.new(params[:option_type])
@product = Product.find_by_param!(params[:product_id])
if @option_type.save
respond_to do |format|
format.html {
redirect_to admin_option_types_url}
end
end
end
# should be
def create
@option_type = OptionType.new(params[:option_type])
@product = Product.find_by_param!(params[:product_id])
respond_to do |format|
if @option_type.save
format.html {redirect_to admin_option_types_url}
else
format.html { render :action => "new" }
end
end
end