Skip to content

Instantly share code, notes, and snippets.

@mkezfarias
Created February 18, 2020 05:52
Show Gist options
  • Save mkezfarias/3a4914aef4c579e5f265b6a46145ac77 to your computer and use it in GitHub Desktop.
Save mkezfarias/3a4914aef4c579e5f265b6a46145ac77 to your computer and use it in GitHub Desktop.
Rails.application.routes.draw do
# generated by scaffold to take care of all the methods for subjects
resources :subjects
# sends a get request to the show method in the sessions controller
get '/sessions', to: 'sessions#show'
# sends a post request to the show method in the sessions controller with a parameter passed from the view
post '/sessions', to: 'sessions#show', as: :sessions_show
# sends the root to the landig page
root 'welcome#index'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment