class Desktop::JournalListsController < ApplicationController
  def index
    level_types = JournalLevelType.all
    all_journal_lists = WritingJournal.where(create_user_id: current_user.id)
    all_journal_lists = all_journal_lists.map do |j|
      [ j.journal_title,
        j.journal_level_type_ids.map do |type|
         level_types.find(type).title
       end]
    end

    @journal_lists = all_journal_lists.uniq

    respond_to do |format|
      format.html { render :layout => false}
    end
  end
end