self.render_error status: 404
end
+ def render_index
+ respond_to do |f|
+ f.json { render json: @objects }
+ f.html {
+ if params['tab_pane']
+ comparable = self.respond_to? :compare
+ render(partial: 'show_' + params['tab_pane'].downcase,
+ locals: { comparable: comparable, objects: @objects })
+ else
+ render
+ end
+ }
+ f.js { render }
+ end
+ end
+
def index
@limit ||= 200
if params[:limit]
@objects ||= model_class
@objects = @objects.filter(@filters).limit(@limit).offset(@offset).all
- respond_to do |f|
- f.json { render json: @objects }
- f.html {
- if params['tab_pane']
- comparable = self.respond_to? :compare
- render(partial: 'show_' + params['tab_pane'].downcase,
- locals: { comparable: comparable, objects: @objects })
- else
- render
- end
- }
- f.js { render }
- end
+ render_index
end
def show
@group_uuids = @groups.collect &:uuid
@links_from = Link.where link_class: 'permission', tail_uuid: @group_uuids
@links_to = Link.where link_class: 'permission', head_uuid: @group_uuids
- super
+ render_index
end
def show
skip_around_filter :thread_with_mandatory_api_token, :only => [:destroy, :index]
skip_around_filter :thread_with_optional_api_token, :only => [:destroy, :index]
skip_before_filter :find_object_by_uuid, :only => [:destroy, :index]
+
def destroy
session.clear
redirect_to arvados_api_client.arvados_logout_url(return_to: root_url)
end
+
def index
redirect_to root_url if session[:arvados_api_token]
- super
+ render_index
end
end