<commit_before>require 'espresso/controller/inherited_resources'
require 'espresso/view/inherited_resources/manage'

module Espresso
  module Controller
    module InheritedResourcesManage
      extend Espresso::Concern

      module InstanceMethods
        def index
          super do |format|
            format.html do
              render_with_fallback('index')
            end
          end
        end

        def edit
          super do |format|
            format.html do
              render_with_fallback('edit')
            end
          end
        end

        def new
          super do |format|
            format.html do
              render_with_fallback('new')
            end
          end
        end

        def show
          super do |format|
            format.html do
              render_with_fallback('show', 'espresso/edit')
            end
          end
        end

        def create
          super do |success, failure|
            failure.html do
              render_with_fallback('new')
            end
          end
        end

        def update
          super do |success, failure|
            failure.html do
              render_with_fallback('edit')
            end
          end
        end
      end

      module ClassMethods<commit_msg>redirect to collection after successfull creating and updating of the resource	<commit_after>require 'espresso/controller/inherited_resources'
require 'espresso/view/inherited_resources/manage'

module Espresso
  module Controller
    module InheritedResourcesManage
      extend Espresso::Concern

      module InstanceMethods
        def index
          super do |format|
            format.html do
              render_with_fallback('index')
            end
          end
        end

        def edit
          super do |format|
            format.html do
              render_with_fallback('edit')
            end
          end
        end

        def new
          super do |format|
            format.html do
              render_with_fallback('new')
            end
          end
        end

        def show
          super do |format|
            format.html do
              render_with_fallback('show', 'espresso/edit')
            end
          end
        end

        def create
          super do |success, failure|
            success.html do
              redirect_to collection_path
            end
            failure.html do
              render_with_fallback('new')
            end
          end
        end

        def update
          super do |success, failure|
            success.html do
              redirect_to collection_path
            end
            failure.html do
              render_with_fallback('edit')
            end
          end
        end
      end

      module ClassMethods
{'fraction_non_alphanumeric': 0.04480796586059744, 'fraction_numerical': 0.0, 'mean_word_length': 1.2360890302066774, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6982602', 'n_tokens_mistral': 687, 'n_tokens_neox': 670, 'n_words': 192}