Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/casaper/rails_controller_action_name_helpers
Simple helpers to have more readable checks for current controller name or action name in rails views.
https://github.com/casaper/rails_controller_action_name_helpers
Last synced: 7 days ago
JSON representation
Simple helpers to have more readable checks for current controller name or action name in rails views.
- Host: GitHub
- URL: https://github.com/casaper/rails_controller_action_name_helpers
- Owner: casaper
- License: mit
- Created: 2020-03-21T21:10:42.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-18T19:20:56.000Z (almost 2 years ago)
- Last Synced: 2024-04-24T17:42:15.432Z (8 months ago)
- Language: Ruby
- Size: 111 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rails Controller Action Name Helpers
[Repository - casaper/rails_controller_action_name_helpers](https://github.com/casaper/rails_controller_action_name_helpers)
[Documentation](https://casaper.github.io/rails_controller_action_name_helpers/)Simple view helpers to have more readable checks for current controller name or action name.
```haml
- # this condition here
- if action_name == 'index' && (controller_name == 'members' || controller_name == 'users')
%p This will only show if the partial is run on the index action on the members or users controller
- # can be done like this
- if ca_index?(:members, :users)
%p This will only show if the partial is run on the index action on the members or users controller
```