I'm creating mobile api using rails-api and when a user goes to the url for the api, I get the expected "Welcome Aboard" page. What I want to do is remove this and just give the user a 403 page (or 404), if the user attempts to go to the root url with a web browser.
I know that I can create a controller (error_pages), and then match it to a method (no_access) in routes.rb, and then have a page that is rendered by default in the views directory.
root 'error_pages#no_access' # in routes.rb
I'm assuming that there would be an easier way to accomplish this with Rails magic.
Edit:
I found this SO article:
Where is the default "Welcome Aboard" page located in my app?
It states that beginning with Rails 4, the index.html is no longer in the public/ directory, as it is contained in a gem.
Is it possible in the routes.rb file to just point to one of the error pages in the public directory?
I tried the following and it doesn't work:
root 'public/404.html'
I would hate to create a controller to just point to an error page, is there a better rails way?