diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb index 53178af..5db3e36 100644 --- a/app/controllers/api_controller.rb +++ b/app/controllers/api_controller.rb @@ -21,11 +21,14 @@ class ApiController < ApplicationController def regexp_preview preview = RegexpPreview.processor(params[:format]).new(params[:file], params[:format], params) matches = preview.matches + render json: { params: { setting: { - regexp: preview.regexp.try(:source), - time_format: preview.time_format, + # NOTE: regexp and timeformat are used when format == 'apache' || 'nginx' || etc. + # TODO: prepare rendered JSON by prcessor(RegexpPreview::{Signle,Multi}Line + regexp: preview.try(:regexp).try(:source), + time_format: preview.try(:time_format), } }, matches: matches.compact,