Browse Source

update post create url

CLDC-1324
Kat 2 years ago
parent
commit
9b2d4fa5f0
  1. 3
      app/controllers/form_controller.rb
  2. 4
      app/controllers/lettings_logs_controller.rb
  3. 2
      app/controllers/logs_controller.rb
  4. 4
      app/controllers/sales_logs_controller.rb

3
app/controllers/form_controller.rb

@ -60,7 +60,6 @@ class FormController < ApplicationController
end
end
private
def restore_error_field_values
@ -143,7 +142,7 @@ private
end
def new_log_request_referrer?
request.referer.split("/").include?("new")
request.referer&.split("/").include?("new")
end
def is_referrer_check_answers?

4
app/controllers/lettings_logs_controller.rb

@ -101,7 +101,7 @@ private
@log = LettingsLog.find_by(id: params[:id])
end
def post_create_redirect_url(log)
lettings_log_url(log)
def post_create_redirect_url
new_log_lettings_logs_path
end
end

2
app/controllers/logs_controller.rb

@ -15,7 +15,7 @@ private
respond_to do |format|
format.html do
redirect_to(request.path.include?("sales") ? new_log_sales_logs_path : new_log_lettings_logs_path)
redirect_to(post_create_redirect_url)
end
format.json do
if log.save

4
app/controllers/sales_logs_controller.rb

@ -40,8 +40,8 @@ class SalesLogsController < LogsController
end
end
def post_create_redirect_url(log)
sales_log_url(log)
def post_create_redirect_url
new_log_sales_logs_path
end
def permitted_log_params

Loading…
Cancel
Save