Class: Ask::Generators::ActionGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/ask/action_generator.rb

Overview

Creates an action under app/actions. Actions are operations callable from any channel by name — dispatch them with Ask::Actions.dispatch.

rails generate ask:action create_workspace
# => app/actions/create_workspace.rb  (dispatch name: "create_workspace")

rails generate ask:action chats create
# => app/actions/chats/create.rb      (dispatch name: "chats.create")

Instance Method Summary collapse

Instance Method Details

#create_actionObject



20
21
22
# File 'lib/generators/ask/action_generator.rb', line 20

def create_action
  template "action.rb", action_path
end