This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
orbit-4-1/app/controllers/desktop/journal_lists_controller.rb

84 lines
2.5 KiB
Ruby

class Desktop::JournalListsController < ApplicationController
# GET /desktop/journal_lists
# GET /desktop/journal_lists.json
def index
@desktop_journal_lists = Desktop::JournalList.all
respond_to do |format|
format.html # index.html.erb
format.json { render json: @desktop_journal_lists }
end
end
# GET /desktop/journal_lists/1
# GET /desktop/journal_lists/1.json
def show
@desktop_journal_list = Desktop::JournalList.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @desktop_journal_list }
end
end
# GET /desktop/journal_lists/new
# GET /desktop/journal_lists/new.json
def new
@desktop_journal_list = Desktop::JournalList.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @desktop_journal_list }
end
end
# GET /desktop/journal_lists/1/edit
def edit
@desktop_journal_list = Desktop::JournalList.find(params[:id])
end
# POST /desktop/journal_lists
# POST /desktop/journal_lists.json
def create
@desktop_journal_list = Desktop::JournalList.new(params[:desktop_journal_list])
respond_to do |format|
if @desktop_journal_list.save
format.html { redirect_to @desktop_journal_list, notice: 'Journal list was successfully created.' }
format.json { render json: @desktop_journal_list, status: :created, location: @desktop_journal_list }
else
format.html { render action: "new" }
format.json { render json: @desktop_journal_list.errors, status: :unprocessable_entity }
end
end
end
# PUT /desktop/journal_lists/1
# PUT /desktop/journal_lists/1.json
def update
@desktop_journal_list = Desktop::JournalList.find(params[:id])
respond_to do |format|
if @desktop_journal_list.update_attributes(params[:desktop_journal_list])
format.html { redirect_to @desktop_journal_list, notice: 'Journal list was successfully updated.' }
format.json { head :ok }
else
format.html { render action: "edit" }
format.json { render json: @desktop_journal_list.errors, status: :unprocessable_entity }
end
end
end
# DELETE /desktop/journal_lists/1
# DELETE /desktop/journal_lists/1.json
def destroy
@desktop_journal_list = Desktop::JournalList.find(params[:id])
@desktop_journal_list.destroy
respond_to do |format|
format.html { redirect_to desktop_journal_lists_url }
format.json { head :ok }
end
end
end