current_page?
doesn't work with POST requests, but there is said to be a solution here.
I try using url_for
like so:
current_page?(url_for(controller: 'pages', action: 'booking_confirm'))
# but..
ActionController::UrlGenerationError in Pages#index
No route matches {:action=>"booking_confirm", :controller=>"pages"}
For reference, here are the attempts that fail due to the request being POST
# 1
current_page?(url_for('/booking_confirm'))
# 2
current_page?('/booking_confirm')
Also, here's some interesting knowledge on the matter. I don't fully understand it, but it hints that current_page?
may not be able to do what I need it to do, but I ask here in case someone has some ideas