Module: Gaku::SharedHelper
- Included in:
- AdminHelper
- Defined in:
- app/helpers/gaku/shared_helper.rb
Instance Method Summary collapse
- #can_edit? ⇒ Boolean
- #disabled?(country_preset) ⇒ Boolean
- #genders ⇒ Object
- #render_flash ⇒ Object
- #state_load(country_preset) ⇒ Object
Instance Method Details
#can_edit? ⇒ Boolean
4 5 6 |
# File 'app/helpers/gaku/shared_helper.rb', line 4 def can_edit? %w( edit create update ).include? action_name end |
#disabled?(country_preset) ⇒ Boolean
21 22 23 24 25 26 27 28 |
# File 'app/helpers/gaku/shared_helper.rb', line 21 def disabled?(country_preset) country = Gaku::Country.find_by(iso: country_preset) if country country.states_required else true end end |
#genders ⇒ Object
8 9 10 |
# File 'app/helpers/gaku/shared_helper.rb', line 8 def genders { t(:'gender.female') => false, t(:'gender.male') => true } end |
#render_flash ⇒ Object
30 31 32 |
# File 'app/helpers/gaku/shared_helper.rb', line 30 def render_flash escape_javascript(render 'gaku/shared/flash', flash: flash) end |