Sha256: 40ea4a5fb80ed34941c985b2e6d6224c5435cd6c1fffdf966cc24992089ec47f
Contents?: true
Size: 972 Bytes
Versions: 11
Compression:
Stored size: 972 Bytes
Contents
# frozen_string_literal: true require "rails/generators/base" module ShopifyApp module Generators class AddMarketingActivityExtensionGenerator < Rails::Generators::Base source_root File.expand_path("../templates", __FILE__) def generate_app_extension template("marketing_activities_controller.rb", "app/controllers/marketing_activities_controller.rb") generate_routes end private def generate_routes inject_into_file( "config/routes.rb", optimize_indentation(routes, 2), after: "root :to => 'home#index'\n" ) end def routes <<~EOS resource :marketing_activities, only: [:create, :update] do patch :resume patch :pause patch :delete post :republish post :preload_form_data post :preview post :errors end EOS end end end end
Version data entries
11 entries across 11 versions & 1 rubygems