Added notice message for destroy method in scaffold

This commit is contained in:
Rahul P. Chaudhari 2013-02-09 22:40:45 +05:30
parent da483d3f30
commit afdb84a1fe
3 changed files with 6 additions and 1 deletions

View File

@ -1,5 +1,9 @@
## Rails 4.0.0 (unreleased) ##
* Added notice message for destroy action in scaffold generator
*Rahul P. Chaudhari*
* Add --rc option to support the load of a custom rc file during the generation of a new app.
*Amparo Luna*

View File

@ -47,7 +47,7 @@ class <%= controller_class_name %>Controller < ApplicationController
# DELETE <%= route_url %>/1
def destroy
@<%= orm_instance.destroy %>
redirect_to <%= index_helper %>_url
redirect_to <%= index_helper %>_url, notice: <%= "'#{human_name} was successfully destroyed.'" %>
end
private

View File

@ -39,6 +39,7 @@ class ScaffoldControllerGeneratorTest < Rails::Generators::TestCase
assert_instance_method :destroy, content do |m|
assert_match(/@user\.destroy/, m)
assert_match(/User was successfully destroyed/, m)
end
assert_instance_method :set_user, content do |m|