
Untitled
By: a guest on Jan 28th, 2012 | syntax:
None | size: 0.62 KB | hits: 15 | expires: Never
def update
params[:option_type][:option_value_attributes] ||= {}
@option_type = OptionType.find(params[:id])
@option_type.save
respond_to do |format|
format.html {
redirect_to admin_option_types_url}
end
end
# should be
def update
params[:option_type][:option_value_attributes] ||= {}
@option_type = OptionType.find(params[:id])
respond_to do |format|
if @option_type.update_attributes(params[:option_type])
format.html {redirect_to admin_option_types_url}
else
format.html { render :action => "edit" }
end
end
end