Class: Wco::Api::NewsvideosController
- Inherits:
-
Wco::ApiController
- Object
- Wco::ApiController
- Wco::Api::NewsvideosController
- Defined in:
- app/controllers/wco/api/newsvideos_controller.rb
Instance Method Summary collapse
-
#generate_illustration ⇒ Object
the other one is used, not this one.
Instance Method Details
#generate_illustration ⇒ Object
the other one is used, not this one. Because I don’t want to deal with api keys.
12 13 14 15 16 17 18 19 20 21 |
# File 'app/controllers/wco/api/newsvideos_controller.rb', line 12 def generate_illustration @newsvideo = Wco::Newsvideo.unscoped.find params[:id] Rails.env.production? ? Wco::NewsvideoIllustrationJob.perform_async(@newsvideo.id.to_s, params[:image_url]) : Wco::NewsvideoIllustrationJob.perform_sync( @newsvideo.id.to_s, params[:image_url]) render json: { status: :ok, message: 'scheduled the run on pc-ai' } # redirect_to action: 'show', newsvideo_id: params[:id] end |