Class: Journeybook::Admin::AiStylePromptsController
- Inherits:
-
Journeybook::ApplicationController
- Object
- ActionController::Base
- Journeybook::ApplicationController
- Journeybook::Admin::AiStylePromptsController
- Defined in:
- app/controllers/journeybook/admin/ai_style_prompts_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/journeybook/admin/ai_style_prompts_controller.rb', line 14 def create @style_prompt = AiStylePrompt.new(style_prompt_params) if @style_prompt.save redirect_to admin_ai_style_prompts_path, notice: "AI style prompt created." else render :new, status: :unprocessable_entity end end |
#destroy ⇒ Object
35 36 37 38 |
# File 'app/controllers/journeybook/admin/ai_style_prompts_controller.rb', line 35 def destroy @style_prompt.destroy redirect_to admin_ai_style_prompts_path, notice: "AI style prompt deleted." end |
#edit ⇒ Object
24 25 |
# File 'app/controllers/journeybook/admin/ai_style_prompts_controller.rb', line 24 def edit end |
#index ⇒ Object
6 7 8 |
# File 'app/controllers/journeybook/admin/ai_style_prompts_controller.rb', line 6 def index @style_prompts = AiStylePrompt.order(:name) end |
#new ⇒ Object
10 11 12 |
# File 'app/controllers/journeybook/admin/ai_style_prompts_controller.rb', line 10 def new @style_prompt = AiStylePrompt.new end |
#update ⇒ Object
27 28 29 30 31 32 33 |
# File 'app/controllers/journeybook/admin/ai_style_prompts_controller.rb', line 27 def update if @style_prompt.update(style_prompt_params) redirect_to admin_ai_style_prompts_path, notice: "AI style prompt updated." else render :edit, status: :unprocessable_entity end end |