Class: Ilog::Controllers::Digital::Show

Inherits:
Object
  • Object
show all
Includes:
Action, Helpers
Defined in:
lib/ilog/controllers/digital/show.rb

Instance Method Summary collapse

Methods included from Helpers

#get_database, #get_namespace, #set_database

Instance Method Details

#call(params) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/ilog/controllers/digital/show.rb', line 9

def call(params)
 set_database params[:domain]
 req = request.env['HTTP_ACCEPT']
      if req.include? 'application/json'
          post = ::Post.find(params[:id])
          Post.namespace = set_database params[:domain]
          self.format = :json
          self.body = post.to_json(:include => ::Post::DIMENSIONS + ::Post::GROUPINGS, :methods => [:content])
        else
          index = Index::Digital.new
          index.call params
        end
end