Add configure action to configure parse/format section

Signed-off-by: Kenji Okimoto <okimoto@clear-code.com>
This commit is contained in:
Kenji Okimoto 2018-06-07 16:47:52 +09:00
parent 421cbdd1af
commit 6ef0380b3e
2 changed files with 15 additions and 0 deletions

View File

@ -10,11 +10,21 @@ module SettingConcern
def show
@setting = target_class.new(initial_params)
@parser = @setting.create_parser
@formatter = @setting.create_formatter
@_used_param = {}
@_used_section = {}
render "shared/settings/show"
end
def configure
owned_keys = %i(parse_type format_type)
@setting = target_class.new(initial_params.merge(params.permit(*owned_keys).slice(*owned_keys)))
@parser = @setting.create_parser
@formatter = @setting.create_formatter
render "shared/settings/show"
end
def finish
@setting = target_class.new(setting_params)
@_used_param = {}

View File

@ -20,12 +20,14 @@ Rails.application.routes.draw do
resource :in_tail, only: [:show], module: :settings, controller: :in_tail do
post "after_file_choose"
# get "configure"
post "after_format"
post "confirm"
post "finish"
end
resource :in_syslog, only: [:show], module: :settings, controller: :in_syslog do
get "configure"
post "finish"
end
@ -34,6 +36,7 @@ Rails.application.routes.draw do
end
resource :in_http, only: [:show], module: :settings, controller: :in_http do
get "configure"
post "finish"
end
@ -42,6 +45,7 @@ Rails.application.routes.draw do
end
resource :out_stdout, only: [:show], module: :settings, controller: :out_stdout do
get "configure"
post "finish"
end
@ -54,6 +58,7 @@ Rails.application.routes.draw do
end
resource :out_s3, only: [:show], module: :settings, controller: :out_s3 do
get "configure"
post "finish"
end