Class: Ilog::Controllers::Index::Digital

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

Instance Method Summary collapse

Methods included from Helpers

#get_database, #get_namespace, #set_database

Instance Method Details

#call(params) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/ilog/controllers/index/digital.rb', line 10

def call(params)
    set_database params[:domain]

    # variable set for front-end vue
 @vue_config = Ilog.configuration

    # rest of action
    @namespace = get_namespace params[:domain]
 req = request.env['HTTP_ACCEPT']

    if req.include? 'application/json'
		   		post = ::Post.find(params[:id])
		   		post.namespace = get_database params[:domain]
		   		self.format = :json
		   		self.body = post.to_json(:include => ::Post::DIMENSIONS.force_encoding(Encoding::UTF_8) + ::Post::GROUPINGS.force_encoding(Encoding::UTF_8), :methods => [:content].force_encoding(Encoding::UTF_8))
		   	end
end