Merge b9a2a80a75 into 24f0625be1
This commit is contained in:
commit
8384f7a00e
3 changed files with 82 additions and 1 deletions
|
|
@ -1,6 +1,13 @@
|
|||
class ConferenceController < ApplicationController
|
||||
before_filter :respond_to_options
|
||||
load_and_authorize_resource find_by: :short_title
|
||||
skip_before_filter :verify_authenticity_token, if: :json_request?
|
||||
|
||||
def json_request?
|
||||
return false if request.request_method != 'GET'
|
||||
return false if !request.format.json?
|
||||
true
|
||||
end
|
||||
|
||||
def index
|
||||
@current = Conference.where('end_date >= ?', Date.current).order('start_date ASC')
|
||||
|
|
@ -19,6 +26,11 @@ class ConferenceController < ApplicationController
|
|||
else
|
||||
@today = @conference.start_date.strftime('%Y-%m-%d')
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.json { render json: @conference.as_json, callback: params[:callback] }
|
||||
end
|
||||
end
|
||||
|
||||
def gallery_photos
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue