Implement role authorization

This commit is contained in:
Stella Rouzi 2014-08-12 11:51:59 +03:00
parent 6755328c4c
commit e2fb434dc7
122 changed files with 1386 additions and 751 deletions

View file

@ -1,7 +1,7 @@
class ConferenceController < ApplicationController
load_and_authorize_resource find_by: :short_title
def show
@conference = Conference.find_by_short_title(params[:id])
redirect_to root_path, notice: "Conference not ready yet!!" unless @conference.make_conference_public?
end
def subscribe
@ -41,7 +41,7 @@ class ConferenceController < ApplicationController
end
def gallery_photos
@photos = Conference.find_by_short_title(params[:id]).photos
@photos = @conference.photos
render "photos", formats: [:js]
end
end