aboutsummaryrefslogtreecommitdiffstats
path: root/railties/generators/scaffold/templates/controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/generators/scaffold/templates/controller.rb')
-rw-r--r--railties/generators/scaffold/templates/controller.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/railties/generators/scaffold/templates/controller.rb b/railties/generators/scaffold/templates/controller.rb
index 15ade4c49b..7ccb517bee 100644
--- a/railties/generators/scaffold/templates/controller.rb
+++ b/railties/generators/scaffold/templates/controller.rb
@@ -1,6 +1,4 @@
-class <%= class_name %>Controller < ApplicationController
- layout 'scaffold'
-
+class <%= @controller_class_name %>Controller < ApplicationController
<% unless suffix -%>
def index
list
@@ -41,8 +39,7 @@ class <%= class_name %>Controller < ApplicationController
def update
@<%= singular_name %> = <%= class_name %>.find(@params['<%= singular_name %>']['id'])
- @<%= singular_name %>.attributes = @params['<%= singular_name %>']
- if @<%= singular_name %>.save
+ if @<%= singular_name %>.update_attributes(@params['<%= singular_name %>'])
flash['notice'] = '<%= class_name %> was successfully updated.'
redirect_to :action => 'show<%= suffix %>', :id => @<%= singular_name %>.id
else