RubyGems Navigation menu

handy_generators 0.1.10

## Usage ### Edit Links Helper ``` rails generate handy_generators:edit_links_helper ``` \n 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. \n ``` rails generate handy_generators:edit_links_helper --pundit false ``` \n #### Helpers `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.5 KB)
  2. 0.1.11 October 02, 2018 (11.0 KB)
  3. 0.1.10 October 02, 2018 (11.0 KB)
  4. 0.1.9 October 02, 2018 (11.0 KB)
  5. 0.1.8 October 02, 2018 (10.5 KB)
显示所有版本 (共 7 个)

Runtime 依赖 (1):

rails > 4.0

Development 依赖 (4):

bundler ~> 1.16
rails > 4.0
rake ~> 10.0

所有者:

作者:

  • DakotaLMartinez

SHA 256 校验和:

=

下载总量 10,197

这个版本 1,586

版本发布:

许可:

MIT

需要的 Ruby 版本: >= 0

链接: