mirror of https://github.com/rails/rails
Added notice message for destroy method in scaffold
This commit is contained in:
parent
da483d3f30
commit
afdb84a1fe
|
@ -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*
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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|
|
||||
|
|
Loading…
Reference in New Issue