lib/generators/adhoc/portfolio/templates/actions/update.rb in adhoc-generators-0.0.4 vs lib/generators/adhoc/portfolio/templates/actions/update.rb in adhoc-generators-0.0.5
- old
+ new
@@ -1,8 +1,7 @@
def update
- @<%= instance_name %> = <%= model_name %>.find(params[:id])
- if @<%= instance_name %>.update_attributes(params[:<%= instance_name %>])
- redirect_to <%= item_url %>, :notice => "Successfully updated <%= model_name.underscore.humanize.downcase %>."
+ if @<%= instance_name %>.update_attributes(<%= instance_name %>_params)
+ redirect_to <%= item_url %>, notice: "Successfully updated <%= model_name.underscore.humanize.downcase %>."
else
render :edit
end
- end
+ end
\ No newline at end of file