Skip to content
Simple helpers to have more readable checks for current controller name or action name in rails views.
Ruby
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app/helpers
bin
certs
docs
lib
.gitignore
.rubocop.yml
.ruby-version
.yardopts
Gemfile
Gemfile.lock
LICENSE
README.md
Rakefile
rails_controller_action_name_helpers.gemspec

README.md

Rails Controller Action Name Helpers

Repository - casaper/rails_controller_action_name_helpers
Documentation

Simple view helpers to have more readable checks for current controller name or action name.

- # 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
You can’t perform that action at this time.