weteamsteve / squadsnap2

The #2 sports team management app that makes communication and organization a breeze. Clubs and leagues love us too. Try it now.
1 stars 0 forks source link

Handle unknown routes on front end #10

Open weteamsteve opened 5 years ago

weteamsteve commented 5 years ago

Handle unknown routes on front end.

For example, going to localhost:3000/boats just shows a blank page with login info on the top right.

Show 404 error.

config/routes.rb

  get '/*path' => 'homepage#index'
  # Catch all route with get '/*path' that will direct any other request
  # that doesn’t match the existing routes to the index action of the homepage controller.
  # This way, the routing on the frontend will handle requests that are not related to creating, reading, or deleting squads.

re-render the home component