From 22c690749e154a5426c4f190fbbc08a5dee2eeee Mon Sep 17 00:00:00 2001 From: erdgeist Date: Sat, 25 Jul 2026 17:29:35 +0200 Subject: Retire the unroutable occurrences scaffolding --- app/controllers/occurrences_controller.rb | 97 ------------------------------- app/helpers/occurrences_helper.rb | 2 - app/views/layouts/occurrences.html.erb | 17 ------ app/views/occurrences/edit.html.erb | 32 ---------- app/views/occurrences/index.html.erb | 30 ---------- app/views/occurrences/new.html.erb | 31 ---------- app/views/occurrences/show.html.erb | 28 --------- 7 files changed, 237 deletions(-) delete mode 100644 app/controllers/occurrences_controller.rb delete mode 100644 app/helpers/occurrences_helper.rb delete mode 100644 app/views/layouts/occurrences.html.erb delete mode 100644 app/views/occurrences/edit.html.erb delete mode 100644 app/views/occurrences/index.html.erb delete mode 100644 app/views/occurrences/new.html.erb delete mode 100644 app/views/occurrences/show.html.erb (limited to 'app') diff --git a/app/controllers/occurrences_controller.rb b/app/controllers/occurrences_controller.rb deleted file mode 100644 index 2e3c2ec1..00000000 --- a/app/controllers/occurrences_controller.rb +++ /dev/null @@ -1,97 +0,0 @@ -class OccurrencesController < ApplicationController - - # Private - - before_action :login_required - - # GET /occurrences - # GET /occurrences.xml - def index - @occurrences = Occurrence.all - - respond_to do |format| - format.html # index.html.erb - format.xml { render :xml => @occurrences } - end - end - - # GET /occurrences/1 - # GET /occurrences/1.xml - def show - @occurrence = Occurrence.find(params[:id]) - - respond_to do |format| - format.html # show.html.erb - format.xml { render :xml => @occurrence } - end - end - - # GET /occurrences/new - # GET /occurrences/new.xml - def new - @occurrence = Occurrence.new - - respond_to do |format| - format.html # new.html.erb - format.xml { render :xml => @occurrence } - end - end - - # GET /occurrences/1/edit - def edit - @occurrence = Occurrence.find(params[:id]) - end - - # POST /occurrences - # POST /occurrences.xml - def create - @occurrence = Occurrence.new(occurrence_params) - - respond_to do |format| - if @occurrence.save - flash[:notice] = t("flash.occurrences.created") - format.html { redirect_to(@occurrence) } - format.xml { render :xml => @occurrence, :status => :created, :location => @occurrence } - else - format.html { render :action => "new" } - format.xml { render :xml => @occurrence.errors, :status => :unprocessable_entity } - end - end - end - - # PUT /occurrences/1 - # PUT /occurrences/1.xml - def update - @occurrence = Occurrence.find(params[:id]) - - respond_to do |format| - if @occurrence.update(occurrence_params) - flash[:notice] = t("flash.occurrences.updated") - format.html { redirect_to(@occurrence) } - format.xml { head :ok } - else - format.html { render :action => "edit" } - format.xml { render :xml => @occurrence.errors, :status => :unprocessable_entity } - end - end - end - - # DELETE /occurrences/1 - # DELETE /occurrences/1.xml - def destroy - @occurrence = Occurrence.find(params[:id]) - @occurrence.destroy - - respond_to do |format| - format.html { redirect_to(occurrences_url) } - format.xml { head :ok } - end - end - - private - - def occurrence_params - params.require(:occurrence).permit(:start_time, :end_time, :node_id, :event_id) - end - -end diff --git a/app/helpers/occurrences_helper.rb b/app/helpers/occurrences_helper.rb deleted file mode 100644 index 8cba8817..00000000 --- a/app/helpers/occurrences_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module OccurrencesHelper -end diff --git a/app/views/layouts/occurrences.html.erb b/app/views/layouts/occurrences.html.erb deleted file mode 100644 index ab4aca63..00000000 --- a/app/views/layouts/occurrences.html.erb +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - Occurrences: <%= controller.action_name %> - <%= stylesheet_link_tag 'scaffold' %> - - - -

<%= flash[:notice] %>

- -<%= yield %> - - - diff --git a/app/views/occurrences/edit.html.erb b/app/views/occurrences/edit.html.erb deleted file mode 100644 index aa4f6e07..00000000 --- a/app/views/occurrences/edit.html.erb +++ /dev/null @@ -1,32 +0,0 @@ -

Editing occurrence

- -<%= form_for(@occurrence) do |f| %> - <%= form_error_messages(f) %> - -

- <%= f.label :summary %>
- <%= f.text_field :summary %> -

-

- <%= f.label :start_time %>
- <%= f.datetime_select :start_time %> -

-

- <%= f.label :end_time %>
- <%= f.datetime_select :end_time %> -

-

- <%= f.label :node_id %>
- <%= f.text_field :node_id %> -

-

- <%= f.label :event_id %>
- <%= f.text_field :event_id %> -

-

- <%= f.submit 'Update' %> -

-<% end %> - -<%= link_to 'Show', @occurrence %> | -<%= link_to 'Back', occurrences_path %> diff --git a/app/views/occurrences/index.html.erb b/app/views/occurrences/index.html.erb deleted file mode 100644 index aa084ed9..00000000 --- a/app/views/occurrences/index.html.erb +++ /dev/null @@ -1,30 +0,0 @@ -

Occurrences

- - - - - - - - - - -<% @occurrences.each do |occurrence| %> - - - - - - - - - - -<% end %> -
SummaryStart timeEnd timeNodeEvent
<%=h occurrence.summary %><%=h occurrence.start_time %><%=h occurrence.end_time %><%=h occurrence.node_id %><%=h occurrence.event_id %><%= link_to 'Show', occurrence %><%= link_to 'Edit', edit_occurrence_path(occurrence) %><%= button_to occurrence, method: :delete, form: { data: { confirm: 'Are you sure?' }, class: 'button_to destructive' } do %> - <%= icon("trash", library: "tabler", "aria-hidden": true) %> Destroy - <% end %>
- -
- -<%= link_to 'New occurrence', new_occurrence_path %> diff --git a/app/views/occurrences/new.html.erb b/app/views/occurrences/new.html.erb deleted file mode 100644 index c05ce400..00000000 --- a/app/views/occurrences/new.html.erb +++ /dev/null @@ -1,31 +0,0 @@ -

New occurrence

- -<%= form_for(@occurrence) do |f| %> - <%= form_error_messages(f) %> - -

- <%= f.label :summary %>
- <%= f.text_field :summary %> -

-

- <%= f.label :start_time %>
- <%= f.datetime_select :start_time %> -

-

- <%= f.label :end_time %>
- <%= f.datetime_select :end_time %> -

-

- <%= f.label :node_id %>
- <%= f.text_field :node_id %> -

-

- <%= f.label :event_id %>
- <%= f.text_field :event_id %> -

-

- <%= f.submit 'Create' %> -

-<% end %> - -<%= link_to 'Back', occurrences_path %> diff --git a/app/views/occurrences/show.html.erb b/app/views/occurrences/show.html.erb deleted file mode 100644 index 9e831cf3..00000000 --- a/app/views/occurrences/show.html.erb +++ /dev/null @@ -1,28 +0,0 @@ -

- Summary: - <%=h @occurrence.summary %> -

- -

- Start time: - <%=h @occurrence.start_time %> -

- -

- End time: - <%=h @occurrence.end_time %> -

- -

- Node: - <%=h @occurrence.node_id %> -

- -

- Event: - <%=h @occurrence.event_id %> -

- - -<%= link_to 'Edit', edit_occurrence_path(@occurrence) %> | -<%= link_to 'Back', occurrences_path %> \ No newline at end of file -- cgit v1.3