Module: Capybara::ActiveAdmin::Util
- Defined in:
- lib/capybara/active_admin/util.rb
Class Method Summary collapse
- .options_with_text(text, options = {}) ⇒ Object
-
.parse_model_name(model_name, singular: true) ⇒ Object
Common pure utility functions.
Class Method Details
.options_with_text(text, options = {}) ⇒ Object
16 17 18 19 20 |
# File 'lib/capybara/active_admin/util.rb', line 16 def (text, = {}) key = [:exact] ? :exact_text : :text .except(:exact).merge(key => text) end |
.parse_model_name(model_name, singular: true) ⇒ Object
Common pure utility functions
8 9 10 11 12 13 14 |
# File 'lib/capybara/active_admin/util.rb', line 8 def parse_model_name(model_name, singular: true) return if model_name.nil? model_name = model_name.model_name.singular if model_name.is_a?(Class) model_name = model_name.to_s.gsub(' ', '_').downcase singular ? model_name.singularize : model_name.pluralize end |