repositories_controller.rb revision ac24fe7991ded663db092bd5480ef9c52c14a86f
58a46e06210a6321c530735f15f66eb648c4657dSerge Hallynclass RepositoriesController < ApplicationController
58a46e06210a6321c530735f15f66eb648c4657dSerge Hallyn load_and_authorize_resource :except => [:index, :show]
58a46e06210a6321c530735f15f66eb648c4657dSerge Hallyn commit_id = @repository.commit_id(params[:oid])
58a46e06210a6321c530735f15f66eb648c4657dSerge Hallyn @info = @repository.path_info(params[:path], @oid)
58a46e06210a6321c530735f15f66eb648c4657dSerge Hallyn raise Repository::FileNotFoundError, @path if @info.nil?
58a46e06210a6321c530735f15f66eb648c4657dSerge Hallyn case @info[:type]
58a46e06210a6321c530735f15f66eb648c4657dSerge Hallyn render text: @repository.read_file(@path, params[:oid])[:content],
58a46e06210a6321c530735f15f66eb648c4657dSerge Hallyn content_type: Mime::Type.lookup('application/force-download')