lib/templates/actions/update.rb in thesilverspoon-0.0.22 vs lib/templates/actions/update.rb in thesilverspoon-0.0.23

- old
+ new

@@ -1,8 +1,14 @@ def update @<%= instance_name %> = <%= class_name %>.find(params[:id]) if @<%= instance_name %>.update_attributes(params[:<%= instance_name %>]) - redirect_to <%= items_url %>, :notice => "Successfully updated <%= class_name.underscore.humanize.downcase %>." + if !params[:integrated_view].nil? + redirect_to <%= item_resource.pluralize %>_integrated_view_path, :notice => "Successfully created <%= class_name.underscore.humanize.downcase %>." +else + redirect_to <%= items_url %>, :notice => "Successfully created <%= class_name.underscore.humanize.downcase %>." +end + + else render :edit end - end \ No newline at end of file + end