2012-11-28 03:45:23 +00:00
|
|
|
class Desktop::JournalListsController < ApplicationController
|
|
|
|
def index
|
2012-11-30 15:50:46 +00:00
|
|
|
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
|
2012-12-05 07:33:47 +00:00
|
|
|
end]
|
2012-11-30 15:50:46 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
@journal_lists = all_journal_lists.uniq
|
2012-11-28 03:45:23 +00:00
|
|
|
|
|
|
|
respond_to do |format|
|
2012-11-30 15:50:46 +00:00
|
|
|
format.html { render :layout => false}
|
2012-11-28 03:45:23 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|