rails g sessions controller in rails
rails g controller sessions new create destroy
Explanation for each step:
rails
: The Rails command-line tool used to interact with your Rails application.g controller
: Short forgenerate controller
, this command creates a new controller in your Rails application.sessions
: The name of the controller being generated, in this case, it's named "sessions."new create destroy
: These are the actions/methods being generated inside the "sessions" controller. It creates three methods:new
,create
, anddestroy
which correspond to the actions for displaying a form, creating a session (typically for logging in), and destroying a session (logging out), respectively.