<commit_before>module UrlHelper

  ##
  ## PSEUDO ROUTE HELPERS
  ##

  #
  # Unlike normal route helpers (ie the ones autogenerated by named routes),
  # these helpers generate hashes. I like being able to easily refer to named
  # routes but to keep the results as a params hash. This is useful for all
  # sorts of things, like testing if a particular url is active or not.
  #

  def groups_params(options={})
    options[:id] ||= @group
    return networks_params(options) if options[:id] and options[:id].network?
    {:controller => '/groups', :action => nil}.merge(options)
  end

  def networks_params(options={})
    {:controller => '/networks', :action => nil, :id => @group}.merge(options)
  end

  def directory_params(options={})
    group_type = options.delete(:group_type)

    case group_type
    when :network
      network_directory_params(options)
    when :group
      group_directory_params(options)
    else
      raise "Bad group type #{group_type} for when building directory_params for the url"
    end
  end

  def group_directory_params(options={})
    {:controller => '/groups/directory', :action => nil}.merge(options)
  end

  def network_directory_params(options={})
    {:controller => '/networks/directory', :action => nil}.merge(options)
  end

  def committees_params(options={})
    {:controller => '/groups/committees', :action => nil, :id => @group}.merge(options)
  end

  def councils_params(options={})
    {:controller => '/groups/councils', :action => nil, :id => @group}.merge(options)
  end

  def groups_profiles_params(options={})
    {:controller => '/groups/profiles', :action => nil, :id => @group}.merge(options)
  end

  def groups_memberships_params(options={})
    {:controller => '/groups/memberships', :action => nil, :id => @group}.merge(options)
  end

  def groups_features_params(options={})
    {:controller => '/groups/features', :action => nil, :id => @group}.merge(options)
  end

  def groups_menu_items_params(options={})
    {:controller => '/groups/menu_items', :action => nil, :id => @group}.merge(options)
  end
<commit_msg>update url helper methods for group actions<commit_after>module UrlHelper

  ##
  ## PSEUDO ROUTE HELPERS
  ##

  #
  # Unlike normal route helpers (ie the ones autogenerated by named routes),
  # these helpers generate hashes. I like being able to easily refer to named
  # routes but to keep the results as a params hash. This is useful for all
  # sorts of things, like testing if a particular url is active or not.
  #

  def groups_params(options={})
    options[:id] ||= @group
    return networks_params(options) if options[:id] and options[:id].network?
    {:controller => '/groups', :action => nil}.merge(options)
  end

  def networks_params(options={})
    {:controller => '/networks', :action => nil, :id => @group}.merge(options)
  end

  def directory_params(options={})
    group_type = options.delete(:group_type)

    case group_type
    when :network
      network_directory_params(options)
    when :group
      group_directory_params(options)
    else
      raise "Bad group type #{group_type} for when building directory_params for the url"
    end
  end

  def group_directory_params(options={})
    {:controller => '/groups/directory', :action => nil}.merge(options)
  end

  def network_directory_params(options={})
    {:controller => '/networks/directory', :action => nil}.merge(options)
  end

  def committees_params(options={})
    {:controller => '/groups/committees', :action => nil, :id => @group}.merge(options)
  end

  def councils_params(options={})
    {:controller => '/groups/councils', :action => nil, :id => @group}.merge(options)
  end

  def groups_profiles_params(options={})
    {:controller => '/groups/profiles', :action => nil, :id => @parent || @group}.merge(options)
  end

  def groups_memberships_params(options={})
    {:controller => '/groups/memberships', :action => nil, :id => @group}.merge(options)
  end

  def groups_features_params(options={})
    {:controller => '/groups/features', :action => nil, :id => @parent || @group}.merge(options)
  end

  def groups_menu_items_params(options={})
    {:controller => '/groups/menu_items', :action => nil, :id => @group}.merge(options)
  end

{'fraction_non_alphanumeric': 0.14427157001414428, 'fraction_numerical': 0.0, 'mean_word_length': 4.069295101553166, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 57, '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': '5416288', 'n_tokens_mistral': 1317, 'n_tokens_neox': 1268, 'n_words': 360}