mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-27 03:02:43 -04:00
37 lines
845 B
Ruby
37 lines
845 B
Ruby
class NotificationsController < ApplicationController
|
|
load_and_authorize_resource
|
|
# GET /notifications
|
|
# GET /notifications.json
|
|
def index
|
|
@notifications = Notification.all
|
|
|
|
respond_to do |format|
|
|
format.html # index.html.erb
|
|
format.json { render json: @notifications }
|
|
end
|
|
end
|
|
|
|
# GET /notifications/1
|
|
# GET /notifications/1.json
|
|
def show
|
|
@notification = Notification.find(params[:id])
|
|
|
|
respond_to do |format|
|
|
format.html # show.html.erb
|
|
format.json { render json: @notification }
|
|
end
|
|
end
|
|
|
|
# DELETE /notifications/1
|
|
# DELETE /notifications/1.json
|
|
def destroy
|
|
@notification = Notification.find(params[:id])
|
|
@notification.destroy
|
|
|
|
respond_to do |format|
|
|
format.html { redirect_to notifications_url }
|
|
format.json { head :no_content }
|
|
end
|
|
end
|
|
end
|