Module: Mongoid::Scribe::DocumentsHelper

Included in:
ApplicationController
Defined in:
app/helpers/mongoid/scribe/documents_helper.rb

Instance Method Summary collapse

Instance Method Details

#model_param(model) ⇒ Object



5
6
7
# File 'app/helpers/mongoid/scribe/documents_helper.rb', line 5

def model_param(model)
  model.to_s.underscore.downcase
end

#relation_label(relation) ⇒ Object



9
10
11
12
13
14
15
# File 'app/helpers/mongoid/scribe/documents_helper.rb', line 9

def relation_label(relation)
  if relation.respond_to?(:slug)
    return relation.slug
  else
    return relation.id
  end
end