I have an action, and I've defined it in the routes.rb
resources :statistics, only: [] do
get 'group_report/:id', to: 'statistics#group_report', as: 'group_report'
end
Then in the method in the model, I want to return the full URL.
Thus, I wrote this method
root_url + group_report_statistics_path(id)
The result is "http://localhost:3000//statistics/group_report/DHo6qzUzYXw"
I thought it was a dirty way, and I need to handle the double slash as well.
Does Rails provide some useful method which I can get the full URL of the action directly?