Sha256: 3f27478f09951c8b9e3f781c699b5e90e71a3b4df15e1126f80ab0661738387d

Contents?: true

Size: 642 Bytes

Versions: 2

Compression:

Stored size: 642 Bytes

Contents

module Ilog
  module Controllers
    module Digital
      class Show
        include Ilog::Action
        def call(params)
	        @database = Ilog.configuration.namespaces[params[:domain]]
	        self.set_database @database
	        req = request.env['HTTP_ACCEPT']
			if req.include? 'application/json'
		   		post = ::Post.find(params[:id])
		   		Post.namespace = 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
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ilog-0.3.3 lib/ilog/controllers/digital/show.rb
ilog-0.3.1 lib/ilog/controllers/digital/show.rb