Class: EventsController

Inherits:
ApplicationController
  • Object
show all
Includes:
SocialStream::Controllers::Objects
Defined in:
app/controllers/events_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/events_controller.rb', line 6

def index
  index! do |format|
    format.js {
      events_with_start_and_end
    }

    format.json {
      events_with_start_and_end

      render :json =>
        @events.
          map{ |e| e.to_json(:start => @start_time, :end => @end_time) }.flatten.to_json
    }
  end
end

#showObject



22
23
24
25
26
27
28
29
30
31
32
# File 'app/controllers/events_controller.rb', line 22

def show
  show! do |format|
    format.html { 
      if request.xhr?
        render partial: 'show_modal'
      else
        redirect_to polymorphic_path([ @event.post_activity.receiver_subject, Event.new ], :at => @event.start_at.to_i)
      end
    }
  end
end