RubyGems Navigation menu

handy_generators 0.1.11

## Usage ### Edit Links Helper rails generate handy_generators:edit_links_helper This generator will add a helper and a partial for displaying edit and delete links for a record. This uses pundit by default to check whether a user should be able to edit and/or delete the record before displaying the link. If you'd like to always display these links when you use the helper in the view or handle the logic yourself, simply add --pundit false to your command. rails generate handy_generators:edit_links_helper --pundit false edit_links(record:, edit_classes: '', delete_classes: '') The `edit_links` helper receives three parameters `record`, `edit_classes`, and `delete_classes`. Record is the only required parameter, `edit_classes` and `delete_classes` will be empty by default, if you'd like to add classes you can pass them as parameters to the helper. The default helper uses pundit, and it will check if the logged in user has permission to edit or delete the record before displaying the links. If not, it will display the edit or delete links to all users. `edit_record_link(record:, classes: '')` The `edit_record_link` helper will just display an edit link, it won't check if the user has permission before displaying the link. Classes that you pass in as a parameter will be applied to the link. `delete_record_link(record:, classes: '')` The `delete_record_link` helper will display just display a delete link, with a confirm. It also doesn't check if the user has permission before displaying the link. Classes that you pass in as a parameter will be applied to the link.

Gemfile:
=

インストール:
=

バージョン履歴:

  1. 0.2.0 October 03, 2018 (10.5KB)
  2. 0.1.11 October 02, 2018 (11KB)
  3. 0.1.10 October 02, 2018 (11KB)
  4. 0.1.9 October 02, 2018 (11KB)
  5. 0.1.8 October 02, 2018 (10.5KB)
全てのバージョンを表示(全7件)

Runtime依存関係 (1):

rails > 4.0

Development依存関係 (4):

bundler ~> 1.16
rails > 4.0
rake ~> 10.0

所有者:

作者:

  • DakotaLMartinez

SHA 256チェックサム:

=

累計ダウンロード数 10,204

このバージョンのみ 1,593

このバージョンがリリースされたのは:

ライセンス:

MIT

必要なRubyのバージョン: >= 0

リンク: