Module: EacRailsBase0::Patches::EacRailsUtilsLinksHelper::InstanceMethods
- Defined in:
- lib/eac_rails_base0/patches/eac_rails_utils_links_helper_patch.rb
Instance Method Summary collapse
- #object_path_by_class(*args) ⇒ Object
- #short_object_link(object, action = nil, options = {}) ⇒ Object
Instance Method Details
#object_path_by_class(*args) ⇒ Object
21 22 23 |
# File 'lib/eac_rails_base0/patches/eac_rails_utils_links_helper_patch.rb', line 21 def object_path_by_class(*args) super.gsub(/_url\z/, '_path') end |
#short_object_link(object, action = nil, options = {}) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/eac_rails_base0/patches/eac_rails_utils_links_helper_patch.rb', line 14 def short_object_link(object, action = nil, = {}) value_or_sign(object, '') do |value| path = object_path(value, action) link_to '', url_for(path), if can_by_path?(path, [:method]) end end |