diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2014-04-08 20:54:36 +0200 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2014-04-08 20:57:24 +0200 |
commit | 4b0c8a9467008573c3667641ff533fe611e3df6c (patch) | |
tree | b22870f9c553ba9b6894c20c9b1f4bfe23e4d3ae /railties/lib/rails/generators | |
parent | 75e0ee861f78d6b76ca8d6f7bf74b9dc1ca03bc3 (diff) | |
download | rails-4b0c8a9467008573c3667641ff533fe611e3df6c.tar.gz rails-4b0c8a9467008573c3667641ff533fe611e3df6c.tar.bz2 rails-4b0c8a9467008573c3667641ff533fe611e3df6c.zip |
Use short-form for the scaffold render calls and drop the needless test
Diffstat (limited to 'railties/lib/rails/generators')
-rw-r--r-- | railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb b/railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb index 0e69aa101f..2c3b04043f 100644 --- a/railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb +++ b/railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb @@ -31,7 +31,7 @@ class <%= controller_class_name %>Controller < ApplicationController if @<%= orm_instance.save %> redirect_to @<%= singular_table_name %>, notice: <%= "'#{human_name} was successfully created.'" %> else - render action: 'new' + render :new end end @@ -40,7 +40,7 @@ class <%= controller_class_name %>Controller < ApplicationController if @<%= orm_instance.update("#{singular_table_name}_params") %> redirect_to @<%= singular_table_name %>, notice: <%= "'#{human_name} was successfully updated.'" %> else - render action: 'edit' + render :edit end end |