what determines controller action ruby rails -
at https://www.codecademy.com/en/courses/learn-rails/lessons/start/exercises/start-views, controll action described 'pages#home':
well done! when user visits http://localhost:8000/welcome, route 'welcome' => 'pages#home' tell rails send request pages controller's home action. but when made controller did rails generate controller pages uppercase.
pages_controller.rb:
class pagescontroller < applicationcontroller def home end end is
pagespart ofpages#homedetermined first part ofpages_controller.rb, ignoring_controller.rbend?what happens if change
pages_controller.rbrenamedpages_controller.rbleave class name pagescontroller?
thank you
- yes. ,
#home"action" in pagescontroller - you
uninitialized constant pagescontrollererror
so, controllers should in form namecontroller defined in name_controller.rb, , actions public methods in namecontroller.
Comments
Post a Comment