module MetaMagic::Helper

Public Instance Methods

object_path(object, params = {}) click to toggle source
# File lib/meta_magic/helper.rb, line 7
def object_path(object, params = {})
  action = params.delete(:action) || :show

  send("#{ "#{ action }_" unless action == :show }"\
       "#{ object.class.name.underscore }"\
       "_path", object, params)
end
objects_path(object, params = {}) click to toggle source
# File lib/meta_magic/helper.rb, line 15
def objects_path(object, params = {})
  action = params.delete(:action) || :index

  send("#{ "#{ action }_" unless action == :index }"\
       "#{ object.class.name.pluralize.underscore }"\
       "_path", params)
end