calendar feature generiert
This commit is contained in:
83
app/controllers/calendars_controller.rb
Normal file
83
app/controllers/calendars_controller.rb
Normal file
@@ -0,0 +1,83 @@
|
||||
class CalendarsController < ApplicationController
|
||||
# GET /calendars
|
||||
# GET /calendars.json
|
||||
def index
|
||||
@calendars = Calendar.all
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.json { render json: @calendars }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /calendars/1
|
||||
# GET /calendars/1.json
|
||||
def show
|
||||
@calendar = Calendar.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
format.html # show.html.erb
|
||||
format.json { render json: @calendar }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /calendars/new
|
||||
# GET /calendars/new.json
|
||||
def new
|
||||
@calendar = Calendar.new
|
||||
|
||||
respond_to do |format|
|
||||
format.html # new.html.erb
|
||||
format.json { render json: @calendar }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /calendars/1/edit
|
||||
def edit
|
||||
@calendar = Calendar.find(params[:id])
|
||||
end
|
||||
|
||||
# POST /calendars
|
||||
# POST /calendars.json
|
||||
def create
|
||||
@calendar = Calendar.new(params[:calendar])
|
||||
|
||||
respond_to do |format|
|
||||
if @calendar.save
|
||||
format.html { redirect_to @calendar, notice: 'Calendar was successfully created.' }
|
||||
format.json { render json: @calendar, status: :created, location: @calendar }
|
||||
else
|
||||
format.html { render action: "new" }
|
||||
format.json { render json: @calendar.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PUT /calendars/1
|
||||
# PUT /calendars/1.json
|
||||
def update
|
||||
@calendar = Calendar.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
if @calendar.update_attributes(params[:calendar])
|
||||
format.html { redirect_to @calendar, notice: 'Calendar was successfully updated.' }
|
||||
format.json { head :no_content }
|
||||
else
|
||||
format.html { render action: "edit" }
|
||||
format.json { render json: @calendar.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /calendars/1
|
||||
# DELETE /calendars/1.json
|
||||
def destroy
|
||||
@calendar = Calendar.find(params[:id])
|
||||
@calendar.destroy
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to calendars_url }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
end
|
||||
84
app/controllers/calentries_controller.rb
Normal file
84
app/controllers/calentries_controller.rb
Normal file
@@ -0,0 +1,84 @@
|
||||
class CalentriesController < ApplicationController
|
||||
# GET /calentries
|
||||
# GET /calentries.json
|
||||
def index
|
||||
@calentries = Calentry.all
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.json { render json: @calentries }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /calentries/1
|
||||
# GET /calentries/1.json
|
||||
def show
|
||||
@calentry = Calentry.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
format.html # show.html.erb
|
||||
format.json { render json: @calentry }
|
||||
format.ics { render 'show.ics.erb',}
|
||||
end
|
||||
end
|
||||
|
||||
# GET /calentries/new
|
||||
# GET /calentries/new.json
|
||||
def new
|
||||
@calentry = Calentry.new
|
||||
|
||||
respond_to do |format|
|
||||
format.html # new.html.erb
|
||||
format.json { render json: @calentry }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /calentries/1/edit
|
||||
def edit
|
||||
@calentry = Calentry.find(params[:id])
|
||||
end
|
||||
|
||||
# POST /calentries
|
||||
# POST /calentries.json
|
||||
def create
|
||||
@calentry = Calentry.new(params[:calentry])
|
||||
|
||||
respond_to do |format|
|
||||
if @calentry.save
|
||||
format.html { redirect_to @calentry, notice: 'Calentry was successfully created.' }
|
||||
format.json { render json: @calentry, status: :created, location: @calentry }
|
||||
else
|
||||
format.html { render action: "new" }
|
||||
format.json { render json: @calentry.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PUT /calentries/1
|
||||
# PUT /calentries/1.json
|
||||
def update
|
||||
@calentry = Calentry.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
if @calentry.update_attributes(params[:calentry])
|
||||
format.html { redirect_to @calentry, notice: 'Calentry was successfully updated.' }
|
||||
format.json { head :no_content }
|
||||
else
|
||||
format.html { render action: "edit" }
|
||||
format.json { render json: @calentry.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /calentries/1
|
||||
# DELETE /calentries/1.json
|
||||
def destroy
|
||||
@calentry = Calentry.find(params[:id])
|
||||
@calentry.destroy
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to calentries_url }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user