Orbit/app/controllers/desktop_publications_contro...

39 lines
912 B
Ruby
Raw Normal View History

class DesktopPublicationsController< ApplicationController
def journal_p
render "desktop/journal_p", :layout => false
end
def journal_p_list
render "desktop/journal_pages/list", :layout => false
end
def journal_p_add
render "desktop/journal_pages/add", :layout => false
end
def create_journal
2012-06-28 09:31:48 +00:00
Journal.create(user_id: current_user.id, title: "Google")
b = Array.new
b << {"success"=>"true"}
render :json=>b.to_json
end
def getjournals
2012-06-26 13:09:33 +00:00
@journals = current_user.journals
data = Array.new
@journals.each do |journal|
@papers = journal.papers.all
data << {"title" => journal.title, "papers" => @papers}
end
render :json=>data.to_json
end
2012-06-28 09:31:48 +00:00
def delete_journal
@journals = Journal.find("")
@journals.delete
b = Array.new
b << {"success"=>"true"}
render :json=>b.to_json
end
end