ruby - Michael Hartl's Rails Tutorial ( USER TOUR ) -
https://www.railstutorial.org/book/toy_app
i confused on part:
2.2 user resource on book
i need on cannot navigate users or tour users using command: url action purpose /users index page list users /users/1 show page show user id 1 /users/new new page make new user /users/1/edit edit page edit user id 1
the error says:
the page looking doesn't exist.
may have mistyped address or page may have moved.
if application owner check logs more information.
i not sure wrong did miss before step navigate users?
at 2.2 you've done far create new rails application. won't able navigate users resource there no controller or model.
the code
def hello render html: "hello, world!" end creates "hello" action, displays text "hello world!" mh added route application's root '/' (localhost:3000/ default) line in routes.rb
root 'application#hello' at point, navigating localhost:3000 should see "hello world!" , all.
keep working through tutorial , mh explain in great detail. sounds trying perform crud operations on users resource. you'll need scaffold user model with
$ rails g scaffold user name email *note i've used "name" , "email" actions here can model user see fit. scaffold command creates 7 crud actions, index, new, create, show, edit, update, destroy. creates resourceful routes each action line
resources :users so, recommend continuing tutorial. if want play around crud actions it's simple scaffolding user resource, running bundle install, , rake db:migrate (or rails db:migrate if you're using rails5.
Comments
Post a Comment