application_controller.rb revision 7db6074e03ec38022974f98b07511443f3ca1012
# CanCan Authorization
end
# A foreign key constraint exception from the database
# shorten the message
:flash => {:error => "Whatever you tried to do - the server is unable to process your request because of a foreign key constraint. (#{message})" }
else
# anything else
end
end
end
end
end
end
return @resource_chain if @resource_chain
@resource_chain = []
return @resource_chain
end
@resource_chain = []
return @resource_chain
end
@resource_chain = [ Repository.find_by_path!( controller_name=='repositories' ? params[:id] : params[:repository_id] )]
@resource_chain << CommitReference.new(id)
end
if id = (controller_name=='ontologies' ? params[:id] : params[:ontology_id])
@resource_chain << Ontology.find(id)
end
@resource_chain
end
def after_sign_in_path_for(resource)
request.referrer
end
def after_sign_out_path_for(resource)
request.referrer
end
helper_method :cover_visible?
def cover_visible?
params[:controller] == 'home' && !user_signed_in?
end
helper_method :context_pane_visible?
def context_pane_visible?
if params[:controller] == 'home'
return true
end
if params[:action] != 'index'
return false
end
if %w(search logics repositories).include? params[:controller]
return true
end
if params[:controller] == 'ontologies' && !in_repository?
return true
end
return false
end
end