Module: EacRailsBase0::Patches::EacRailsUtilsLinksHelper::InstanceMethods

Defined in:
lib/eac_rails_base0/patches/eac_rails_utils_links_helper_patch.rb

Instance Method Summary collapse

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


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, options = {})
  value_or_sign(object, '') do |value|
    path = object_path(value, action)
    link_to '', url_for(path), options if can_by_path?(path, options[:method])
  end
end