<commit_before>module ActionController
  module Resources
    def resources_with_confirmation(*entities, &block)
      #resources
      options = entities.extract_options!
      entities.each { |entity|
        map_resource(entity, options.dup, &block)

        resource = Resource.new(entity, options)
        with_options :controller => resource.controller do |map|
          [:create_confirm].each do |action|
            route_path = resource.path + '/' + action.to_s
            route_name = "#{action.to_s}_#{resource.name_prefix}#{resource.singular}"

            map_resource_routes(map, resource, action, route_path, route_name, :post)
          end

          [:update_confirm].each do |action|
            route_path = "#{resource.member_path}#{resource.action_separator}" + action.to_s
            route_name = "#{action.to_s}_#{resource.name_prefix}#{resource.singular}"

            map_resource_routes(map, resource, action, route_path, route_name, :put)
          end
        end
      }
    end
  end
end<commit_msg>Used a option of resources.<commit_after>module ActionController
  module Resources
    def resources_with_confirmation(*entities, &block)
      options = entities.extract_options!

      {
        :collection => {
          :create_confirm => :post,
        },
        :member => {
          :update_confirm => :put,
        }
      }.each {|type, hash|
        options[type] ||= {}
        hash.each{|action, method|
          options[type][action] ||= method
        }
      }

      entities << options

      resources(*entities, &block)
    end
  end
end
{'fraction_non_alphanumeric': 0.11362209667294414, 'fraction_numerical': 0.0, 'mean_word_length': 2.4427645788336934, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, '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': '3931624', 'n_tokens_mistral': 454, 'n_tokens_neox': 451, 'n_words': 90}