Sha256: dd61c71d9e233f7afc1efd0db6255a1ad61d807ea84acfbdff6fa50263c3efeb

Contents?: true

Size: 1.43 KB

Versions: 8

Compression:

Stored size: 1.43 KB

Contents

# BeetleReporter
Short description and motivation.

## Usage
How to use my plugin.

## Installation
Add this line to your application's Gemfile:

```ruby
gem 'beetle_reporter'
```

And then execute:
```bash
$ bundle
```

Or install it yourself as:
```bash
$ gem install beetle_reporter
```

路由
```ruby
mount BeetleReporter::Engine => "/beetle_reporter", as: "beetle_reporter"
```

初始化配置
```ruby
BeetleReporter.configure do |config|
  config.user_class = 'Admin'
  config.user_name_method = 'username'

  config.main_app_root_path_method = 'admins_user_root_path'
  config.main_app_user_path_method = 'admins_user_path'
end
```

实现hook方法
```ruby
class Diary
  def beetle_record_path
    Rails.application.routes.url_helpers.admins_diary_path(id)
  end

  def beetle_hide
    update_columns(is_approved: false)
  end

  def beetle_undo_hide
    update_columns(is_approved: true)
  end

  def beetle_remove
    discard
  end

  def beetle_undo_remove
    undiscard
  end

  def beetle_mute
    true
  end

  def beetle_undo_mute
    true
  end

  def beetle_forbid
    true
  end

  def beetle_undo_forbid
    true
  end

  def beetle_record_partial_path
    "admins/diaries/beetle"
  end
end
```

## 约定
+ 支持 `is_approved` 字段
+ 支持 `discard` 软删 gem

## Contributing
Contribution directions go here.

## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
beetle_reporter-0.1.10 README.md
beetle_reporter-0.1.9 README.md
beetle_reporter-0.1.8 README.md
beetle_reporter-0.1.7 README.md
beetle_reporter-0.1.6 README.md
beetle_reporter-0.1.5 README.md
beetle_reporter-0.1.4 README.md
beetle_reporter-0.1.3 README.md