Remove current access control and load cancan controls
This commit is contained in:
parent
d6df7be6f7
commit
3df8156177
1 changed files with 5 additions and 4 deletions
|
@ -1,5 +1,6 @@
|
||||||
class AlertsController < ApplicationController
|
class AlertsController < ApplicationController
|
||||||
before_filter :authenticate_user!
|
before_filter :authenticate_user!
|
||||||
|
load_and_authorize_resource
|
||||||
# GET /alerts
|
# GET /alerts
|
||||||
# GET /alerts.json
|
# GET /alerts.json
|
||||||
def index
|
def index
|
||||||
|
@ -13,7 +14,7 @@ class AlertsController < ApplicationController
|
||||||
# GET /alerts/1
|
# GET /alerts/1
|
||||||
# GET /alerts/1.json
|
# GET /alerts/1.json
|
||||||
def show
|
def show
|
||||||
@alert = Alert.user_alerts(current_user.id).find(params[:id])
|
@alert = Alert.find(params[:id])
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # show.html.erb
|
format.html # show.html.erb
|
||||||
|
@ -33,7 +34,7 @@ class AlertsController < ApplicationController
|
||||||
|
|
||||||
# GET /alerts/1/edit
|
# GET /alerts/1/edit
|
||||||
def edit
|
def edit
|
||||||
@alert = Alert.user_alerts(current_user.id).find(params[:id])
|
@alert = Alert.find(params[:id])
|
||||||
end
|
end
|
||||||
|
|
||||||
# POST /alerts
|
# POST /alerts
|
||||||
|
@ -54,7 +55,7 @@ class AlertsController < ApplicationController
|
||||||
# PUT /alerts/1
|
# PUT /alerts/1
|
||||||
# PUT /alerts/1.json
|
# PUT /alerts/1.json
|
||||||
def update
|
def update
|
||||||
@alert = Alert.user_alerts(current_user.id).find(params[:id])
|
@alert = Alert.find(params[:id])
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @alert.update_attributes(params[:alert])
|
if @alert.update_attributes(params[:alert])
|
||||||
|
@ -68,7 +69,7 @@ class AlertsController < ApplicationController
|
||||||
# DELETE /alerts/1
|
# DELETE /alerts/1
|
||||||
# DELETE /alerts/1.json
|
# DELETE /alerts/1.json
|
||||||
def destroy
|
def destroy
|
||||||
@alert = Alert.user_alerts(current_user.id).find(params[:id])
|
@alert = Alert.find(params[:id])
|
||||||
@alert.destroy
|
@alert.destroy
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
|
|
Loading…
Reference in a new issue