Skip to content

Commit

Permalink
Filter rails project paths
Browse files Browse the repository at this point in the history
  • Loading branch information
CuddlyBunion341 committed Oct 22, 2024
1 parent 42ecce2 commit 536b2a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/moirai/pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Moirai
class PagesController < ApplicationController
def index
i18n_file_paths = I18n.load_path
yml_file_paths = i18n_file_paths.select { |path| path.end_with?(".yml") || path.end_with?(".yaml") }
yml_file_paths = i18n_file_paths.select { |path| (path.start_with? Rails.root.to_s) && (path.end_with?(".yml") || path.end_with?(".yaml") )}
file_contents = yml_file_paths.map { |path| [path, parse_file(path)] }.to_h
render json: file_contents
end
Expand Down

0 comments on commit 536b2a1

Please sign in to comment.