instance method
destroy
Ruby on Rails 3.0.20
Since v2.3.18 Last seen in v4.2.9Signature
destroy()
DELETE <%= route_url %>/1 DELETE <%= route_url %>/1.xml
Source
# File railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb, line 74
def destroy
@<%= singular_table_name %> = <%= orm_class.find(class_name, "params[:id]") %>
@<%= orm_instance.destroy %>
respond_to do |format|
format.html { redirect_to(<%= index_helper %>_url) }
format.xml { head :ok }
end
Defined in railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb line 74
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Object