Where are rails script-generated routes stored? -


using rails script, have generated 5 column table (id, title, content, created_at, updated_at) , relevant views , controllers using following command:

rails generate scaffold input title:string content:text 

it created few new routes creation, reading, updating , deletion of database entries:

 inputs    /inputs(.:format)           inputs#index                  post   /inputs(.:format)           inputs#create        new_input    /inputs/new(.:format)       inputs#new       edit_input    /inputs/:id/edit(.:format)  inputs#edit            input    /inputs/:id(.:format)       inputs#show                  put    /inputs/:id(.:format)       inputs#update                  delete /inputs/:id(.:format)       inputs#destroy 

but these routes stored? they're not in rails' 'routes.rb' file!

open config/routes.rb file. find entry resources :inputs.

this responsible creation of these restful routes meaningful path helpers see above.

a resource, default, adds 7 actions model - new, edit, create, update, destroy, index, show. these triggered generic uri , http verb (get, post, put, delete)


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -