<commit_before># BugHerd gem

Add the BugHerd widget to your Rails site. [Get a BugHerd account](http://www.bugherd.com/).

## Installation

Add the following to your `Gemfile`:

```ruby
gem "bugherd"
```

...and then run bundle.

Add a file `config/initializers/bugherd.rb` containing:

```ruby
BugHerd.configure do |config|
  config.project_key = 'YOUR KEY HERE'
end
```

Alternatively you can set an environment variable called BUGHERD_PROJECT_KEY.

You can obtain the project key from your project's installation options in BugHerd.

Now add to the *head* tag in your layout(s):

```ruby
<%= bugherd_tag %>
```

## Meta data

BugHerd allows you to pass in extra data which will be added as metadata to any bug your users may log on the page where the widget is rendered.

```ruby
<%= bugherd_tag :metadata => {
  :user_id => current_user.id.to_s,
  :controller => controller.controller_name
} %>
```

## Translation

If you are using the public "Send Feedback" option on your project, you can customise the display text:

```ruby
<%= bugherd_tag :feedback => {
  :tab_text => "Stuur commentaar",
  :option_title_text => "Kies een optie",
  :option_pin_text => "Ik wil graag iets op deze pagina aanwijzen.",
  :option_site_text => "Ik heb commentaar over deze pagina in z'n geheel.",
  :feedback_entry_placeholder => "schrijf hier uw commentaar",
  :feedback_email_placeholder => "uw email adres",
  :feedback_submit_text => "verstuur commentaar",
  :confirm_success_text => "Commentaar is verstuurd.",
  :confirm_loading_text => "Commentaar wordt verstuurd...",<commit_msg>Added instruction on pre-populating email<commit_after># BugHerd gem

Add the BugHerd widget to your Rails site. [Get a BugHerd account](http://www.bugherd.com/).

## Installation

Add the following to your `Gemfile`:

```ruby
gem "bugherd"
```

...and then run bundle.

Add a file `config/initializers/bugherd.rb` containing:

```ruby
BugHerd.configure do |config|
  config.project_key = 'YOUR KEY HERE'
end
```

Alternatively you can set an environment variable called BUGHERD_PROJECT_KEY.

You can obtain the project key from your project's installation options in BugHerd.

Now add to the *head* tag in your layout(s):

```ruby
<%= bugherd_tag %>
```

## Meta data

BugHerd allows you to pass in extra data which will be added as metadata to any bug your users may log on the page where the widget is rendered.

```ruby
<%= bugherd_tag :metadata => { :user_id => current_user.id.to_s, :controller => controller.controller_name } %>
```

## Pre-populate email addresses

If your site has logged in users and you use public feedback, have the email addresses pre-populated:

```ruby
<%= bugherd_tag :reporter => { :email => current_user.email, :required => "true" } %>
```

## Translation

If you are using the public "Send Feedback" option on your project, you can customise the display text:

```ruby
<%= bugherd_tag :feedback => {
  :tab_text => "Stuur commentaar",
  :option_title_text => "Kies een optie",
  :option_pin_text => "Ik wil graag iets op deze pagina aanwijzen.",
  :option_site_text => "Ik heb commentaar over deze pagina in z'n geheel.",
  :feedback_entry_placeholder => "schrijf hier uw commentaar",
  :feedback_email_placeholder => "uw email adres",
  :feedback_submit_text => "verstuur commentaar",
  :confirm_success_text => "Commentaar is verstuurd.",
  :confirm_loading_text => "Commentaar wordt verstuurd...",
{'fraction_non_alphanumeric': 0.11338997949018459, 'fraction_numerical': 0.0, 'mean_word_length': 4.67109634551495, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7498894', 'n_tokens_mistral': 1165, 'n_tokens_neox': 1097, 'n_words': 394}