app/controllers/projects_controller.rb
#
# Removes project after confirmation.
# Confirmation is based on writing project name in input field
#

Removes project after confirmation.
Confirmation is based on writing project name in input field
Removes project after confirmation . Confirmation is based on writing project name in input field
def destroy
    assert_params_must_have :id
    if params[:name_confirmation] == @project.name
      flash[:notice]  = @project.destroy ? 'Project and it\'s activities have been deleted' : 'Error occured while deleting user' 
    else
      flash[:error]   = "The project has not been deleted, since the name was different" 
    end
    redirect_to :action => 'list'
  end
def destroy assert_params_must_have :id if params [ :name_confirmation ] == @project . name flash [ :notice ] = @project . destroy ? 'Project and it\'s activities have been deleted' : 'Error occured while deleting user' else flash [ :error ] = "The project has not been deleted, since the name was different" end redirect_to :action => 'list' end
Removes project after confirmation.
Removes project after confirmation .