<commit_before>class <%= controller_class_name %>Controller < InheritedResources::Base
  
<% if actions -%>
  actions <%= symbol_array_to_expression(actions) %>
<% end -%>
<% if formats -%>
  respond_to <%= symbol_array_to_expression(formats) %>
  
<% end -%>
<% if actions -%>
  before_filter :load_resource, :only => [<%= symbol_array_to_expression(actions & DryScaffoldGenerator::DEFAULT_MEMBER_AUTOLOAD_ACTIONS) %>]
<% end -%>
<% if actions -%>
  before_filter :load_and_paginate_resources, :only => [<%= symbol_array_to_expression(actions & DryScaffoldGenerator::DEFAULT_COLLECTION_AUTOLOAD_ACTIONS) %>]
  
<% end -%>

<% (actions - DryScaffoldGenerator::DEFAULT_CONTROLLER_ACTIONS).each do |action| -%>
  # GET /<%= plural_name %>/<%= action.to_s %>
  def <%= action.to_s %>
    # TODO: Implement action "<%= plural_name %>/<%= action.to_s %>"
  end
  
<% end -%>
  protected
    
    def collection
<% if options[:pagination] -%>
      paginate_options ||= {}
      paginate_options[:page] ||= (params[:page] || 1)
      paginate_options[:per_page] ||= (params[:per_page] || 20)
      @<%= plural_name %> = @<%= model_plural_name %> ||= end_of_association_chain.paginate(paginate_options)
<% else -%>
      @collection = @<%= model_plural_name %> ||= end_of_association_chain.all
<% end -%>
    end
    
    def resource
      @resource = @<%= model_singular_name %> ||= end_of_association_chain.find(params[:id])
    end
    
end<commit_msg>Alias was missing for resource_controller-template, causing unknown method errors in runtime.<commit_after>class <%= controller_class_name %>Controller < InheritedResources::Base
  
<% if actions -%>
  actions <%= symbol_array_to_expression(actions) %>
<% end -%>
<% if formats -%>
  respond_to <%= symbol_array_to_expression(formats) %>
  
<% end -%>
<% if actions -%>
  before_filter :load_resource, :only => [<%= symbol_array_to_expression(actions & DryScaffoldGenerator::DEFAULT_MEMBER_AUTOLOAD_ACTIONS) %>]
<% end -%>
<% if actions -%>
  before_filter :load_and_paginate_resources, :only => [<%= symbol_array_to_expression(actions & DryScaffoldGenerator::DEFAULT_COLLECTION_AUTOLOAD_ACTIONS) %>]
  
<% end -%>

<% (actions - DryScaffoldGenerator::DEFAULT_CONTROLLER_ACTIONS).each do |action| -%>
  # GET /<%= plural_name %>/<%= action.to_s %>
  def <%= action.to_s %>
    # TODO: Implement action "<%= plural_name %>/<%= action.to_s %>"
  end
  
<% end -%>
  protected
    
    def collection
<% if options[:pagination] -%>
      paginate_options ||= {}
      paginate_options[:page] ||= (params[:page] || 1)
      paginate_options[:per_page] ||= (params[:per_page] || 20)
      @<%= plural_name %> = @<%= model_plural_name %> ||= end_of_association_chain.paginate(paginate_options)
<% else -%>
      @collection = @<%= model_plural_name %> ||= end_of_association_chain.all
<% end -%>
    end
    alias :load_and_paginate_resources :collection
    
    def resource
      @resource = @<%= model_singular_name %> ||= end_of_association_chain.find(params[:id])
    end
    alias :load_resource :resource
    
end
{'fraction_non_alphanumeric': 0.16546997389033943, 'fraction_numerical': 0.0019582245430809398, 'mean_word_length': 4.44404973357016, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 0, '>': 61, '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': '1697611', 'n_tokens_mistral': 1133, 'n_tokens_neox': 1046, 'n_words': 163}