I've been told the routes.rb file I've put together looks like it was coded in a panic (it was coded in a panic).
The Rails app I'm developing is an e-learning and not all pages involve quizzing a database.
How do I go about including those pages? Do I NOT use routes at all? Or should pages be a resource? I'm a bit lost about this.
The tutorials all seem to focus on the RESTful interactions and not on the behaviour of the site in general.
Here's my routes file:
Rails.application.routes.draw do
devise_for :users
root :to => 'home#index'
get "elearning" => "home#elearning"
get "howitworks" => "home#howitworks"
get "leadershipstyles" => "home#leadershipstyles"
get "whattypeofleader" => "home#whattypeofleader"
get "showmetheskills" => "home#showmetheskills"
get "safeguarding" => "home#safeguarding"
get "toolsforthejob" => "home#toolsforthejob"
get "whatnext" => "home#whatnext"
get "congratulations" => "home#congratulations"
get "teamwork" => "home#teamwork"
get "presentation" => "home#presentation"
get "planning" => "home#planning"
get "communication" => "home#communication"
# get "newjournal" => "posts#new"
# get "profile" => 'users#show'
# get "profile/edit" => 'users#edit'
resources :users do
resources :posts
end
end
OK, so there's a few pages under the /home route. Is that the right way to go about it? If you could explain a better alternative, I'd appreciate it.