Files
osem/app/controllers/admin/tracks_controller.rb
Stella Rouzi 17ebad413e base controller
Conflicts:
	app/controllers/admin/commercials_controller.rb
	app/controllers/admin/questions_controller.rb
	app/controllers/admin/users_controller.rb
2014-08-14 11:36:07 +03:00

30 lines
886 B
Ruby

module Admin
class TracksController < Admin::BaseController
load_and_authorize_resource :conference, find_by: :short_title
authorize_resource through: :conference
def index
authorize! :index, Track.new(conference_id: @conference.id)
end
def show
respond_to do |format|
format.html { render :tracks_list }
format.json { render json: @conference.tracks.to_json }
end
end
def update
if @conference.update_attributes(params[:conference])
redirect_to(admin_conference_tracks_path(
conference_id: @conference.short_title),
notice: 'Tracks were successfully updated.')
else
redirect_to(admin_conference_tracks_path(
conference_id: @conference.short_title),
notice: 'Tracks update failed.')
end
end
end
end