Orbit/app/controllers/desktop/journal_lists_controller.rb

21 lines
541 B
Ruby

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.join(",")
].join(" -- ")
end
@journal_lists = all_journal_lists.uniq
respond_to do |format|
format.html { render :layout => false}
end
end
end