Class: Muck::VisitsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/muck/visits_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/controllers/muck/visits_controller.rb', line 7

def show
  @entry = Entry.find(params[:id])
  @page_title = @entry.title
  @resource_uri = @entry.resource_uri
  @share = Share.new(:title => @entry.title, :uri => @resource_uri, :entry_id => @entry.id) if GlobalConfig.enable_raker_shares

  if GlobalConfig.enable_raker_comments
    # Show the activities related to this entry
    @activities = @entry.activities.oldest.only_public.find(:all, :include => ['comments'])
    @comment_count = @activities.length + @activities.inject(0) {|n,activity| activity.comments.length + n }
  end
  
  respond_to do |format|
    format.html { render :template => 'visits/show', :layout => 'frame' }
    format.pjs { render :template => 'visits/show', :layout => false }
    format.json { render :json => @entry.as_json }
  end
end