negos_app/app/controllers/admin/wishes_controller.rb
2016-02-16 21:09:48 +01:00

23 lines
405 B
Ruby
Executable File

class Admin::WishesController < ApplicationController
layout "admin"
before_filter :auth_admin
def index
@need = Need.find(params[:need_id])
@wishes = @need.wishes.order(created_at: :desc).page params[:page]
end
def destroy
@wish = Wish.find(params[:id])
if(@wish.destroy)
flash[:notice] = "Intérêt supprimé avec succès."
end
redirect_to :back
end
end