tasks_controller.rb revision 88b797373c26d327d3b57560e5ff32d968c8b065
325N/Aclass TasksController < InheritedResources::Base
325N/A belongs_to :ontology, optional: true
325N/A before_filter :check_read_permissions
325N/A
325N/A def create
325N/A create! do |format|
325N/A if parent
325N/A parent.tasks << resource
325N/A parent.save
325N/A end
325N/A format.html { redirect_to [*resource_chain, :tasks] }
325N/A end
325N/A end
325N/A
325N/A def update
325N/A update! do |format|
325N/A format.html { redirect_to [*resource_chain, :tasks] }
325N/A end
325N/A end
325N/A
325N/A def destroy
325N/A destroy! do |format|
325N/A format.html { redirect_to [*resource_chain, :tasks] }
325N/A end
325N/A end
325N/A
325N/A protected
325N/A
325N/A def check_read_permissions
325N/A authorize! :show, parent.repository if parent
325N/A end
325N/A
325N/Aend
325N/A