My routes file contains:
concern :generic_table do
get 'search_suggestions' => 'search_suggestions'
end
get 'human_resources/' => 'human_resources#index'
namespace :human_resources do
get 'settings/' => 'settings#index'
namespace :settings do
resources :constants do
concerns :generic_table
end
end
end
And it produces:
/human_resources/settings/constants/:constant_id/search_suggestions(.:format)
human_resources/settings/search_suggestions#search_suggestions
I am trying to remove the /:constant_id/
part and it point to the controller action:
human_resources/settings/constants/search_suggestions#search_suggestions
So in finality it would be
/human_resources/settings/constants/search_suggestions(.:format)
human_resources/settings/constants/search_suggestions#search_suggestions
How can I remove the /:constant_id/
part; and point it directly to my controllers action so my search bar my access the search suggestion for AJAX?