forked from bofh/fetsite
AutoCommit Die Aug 4 22:03:01 CEST 2015
This commit is contained in:
@@ -36,7 +36,12 @@
|
||||
if user_signed_in?
|
||||
flash[:error] = "Not authorized to view this page"
|
||||
session[:user_return_to] = nil
|
||||
redirect_to root_url
|
||||
respond_to do |format|
|
||||
format.html {redirect_to root_url}
|
||||
format.js {render text:"alert(\"Not authorized to do this\");", status: 401}
|
||||
end
|
||||
|
||||
|
||||
|
||||
else
|
||||
flash[:error] = "You must first login to view this page"
|
||||
|
||||
@@ -5,15 +5,15 @@ class BeispieleController < ApplicationController
|
||||
include LikeVoteable
|
||||
acts_as_flagable
|
||||
def index
|
||||
unless params[:lva_id].nil?
|
||||
@beispiele= Lva.find(params[:lva_id]).beispiele.accessible_by(current_ability, :show)
|
||||
else
|
||||
@beispiele = Beispiel.accessible_by(current_ability, :show)
|
||||
end
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.json { render json: @beispiele }
|
||||
end
|
||||
# unless params[:lva_id].nil?
|
||||
# @beispiele= Lva.find(params[:lva_id]).beispiele.accessible_by(current_ability, :show)
|
||||
# else
|
||||
# @beispiele = Beispiel.accessible_by(current_ability, :show)
|
||||
# end
|
||||
# respond_to do |format|
|
||||
# format.html # index.html.erb
|
||||
# format.json { render json: @beispiele }
|
||||
# end
|
||||
end
|
||||
|
||||
# GET /beispiele/1
|
||||
|
||||
Reference in New Issue
Block a user