Class: Projects::FindFileController

Inherits:
ApplicationController show all
Includes:
ActionView::Helpers::SanitizeHelper, ExtractsPath, TreeHelper
Defined in:
app/controllers/projects/find_file_controller.rb

Overview

Controller for viewing a repository's file structure

Instance Method Summary collapse

Methods included from TreeHelper

#can_edit_tree?, #commit_in_fork_help, #edit_in_new_fork_notice, #edit_in_new_fork_notice_now, #flatten_tree, #on_top_of_branch?, #render_readme, #render_tree, #tree_breadcrumbs, #tree_edit_branch, #tree_edit_project, #tree_hex_class, #tree_icon, #tree_join, #up_dir_path

Methods included from ExtractsPath

#assign_ref_vars, #extract_ref, #tree

Methods inherited from ApplicationController

#redirect_back_or_default

Methods included from PageLayoutHelper

#blank_container, #container_class, #fluid_layout, #header_title, #nav, #page_card_attributes, #page_card_meta_tags, #page_description, #page_image, #page_title, #sidebar

Methods included from GitlabRoutingHelper

#activity_project_path, #edit_project_path, #edit_project_url, #issue_path, #issue_url, #merge_request_path, #merge_request_url, #milestone_path, #project_builds_path, #project_commits_path, #project_files_path, #project_path, #project_pipelines_path, #project_snippet_url, #project_url, #runner_path, #runners_path, #toggle_subscription_path

Methods included from Gitlab::GonHelper

#add_gon_variables

Methods included from Gitlab::CurrentSettings

#current_application_settings, #fake_application_settings

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Projects::ApplicationController

Instance Method Details

#listObject


19
20
21
22
23
24
25
# File 'app/controllers/projects/find_file_controller.rb', line 19

def list
  file_paths = @repo.ls_files(@ref)

  respond_to do |format|
    format.json { render json: file_paths }
  end
end

#showObject


11
12
13
14
15
16
17
# File 'app/controllers/projects/find_file_controller.rb', line 11

def show
  return render_404 unless @repository.commit(@ref)

  respond_to do |format|
    format.html
  end
end