Orbit/app/controllers/desktop_orbit_controller.rb

20 lines
390 B
Ruby

class DesktopOrbitController< ApplicationController
def orbit
render "desktop/orbit", :layout => false
end
def getevents
@event = params["event"]
@data = Array.new
case @event
when "papers"
@journals = current_user.journals
@journals.each do |journal|
@data << {"title"=> journal.title,"papers"=> journal.papers}
end
end
render :json=>@data.to_json
end
end