fetzneditions

This commit is contained in:
Andreas Stephanides
2013-08-19 15:42:08 +02:00
parent ea0b245d54
commit 4c48a4b769
21 changed files with 508 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/

View File

@@ -0,0 +1,3 @@
// Place all the styles related to the fetzneditions controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

View File

@@ -0,0 +1,83 @@
class FetzneditionsController < ApplicationController
# GET /fetzneditions
# GET /fetzneditions.json
def index
@fetzneditions = Fetznedition.all
respond_to do |format|
format.html # index.html.erb
format.json { render json: @fetzneditions }
end
end
# GET /fetzneditions/1
# GET /fetzneditions/1.json
def show
@fetznedition = Fetznedition.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @fetznedition }
end
end
# GET /fetzneditions/new
# GET /fetzneditions/new.json
def new
@fetznedition = Fetznedition.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @fetznedition }
end
end
# GET /fetzneditions/1/edit
def edit
@fetznedition = Fetznedition.find(params[:id])
end
# POST /fetzneditions
# POST /fetzneditions.json
def create
@fetznedition = Fetznedition.new(params[:fetznedition])
respond_to do |format|
if @fetznedition.save
format.html { redirect_to @fetznedition, notice: 'Fetznedition was successfully created.' }
format.json { render json: @fetznedition, status: :created, location: @fetznedition }
else
format.html { render action: "new" }
format.json { render json: @fetznedition.errors, status: :unprocessable_entity }
end
end
end
# PUT /fetzneditions/1
# PUT /fetzneditions/1.json
def update
@fetznedition = Fetznedition.find(params[:id])
respond_to do |format|
if @fetznedition.update_attributes(params[:fetznedition])
format.html { redirect_to @fetznedition, notice: 'Fetznedition was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "edit" }
format.json { render json: @fetznedition.errors, status: :unprocessable_entity }
end
end
end
# DELETE /fetzneditions/1
# DELETE /fetzneditions/1.json
def destroy
@fetznedition = Fetznedition.find(params[:id])
@fetznedition.destroy
respond_to do |format|
format.html { redirect_to fetzneditions_url }
format.json { head :no_content }
end
end
end

View File

@@ -0,0 +1,2 @@
module FetzneditionsHelper
end

View File

@@ -0,0 +1,3 @@
class Fetznedition < ActiveRecord::Base
attr_accessible :datei, :datum, :desc, :title
end

View File

@@ -0,0 +1,12 @@
<%= semantic_form_for @fetznedition do |f| %>
<%= f.inputs do %>
<%= f.input :title %>
<%= f.input :desc %>
<%= f.input :datum %>
<%= f.input :datei %>
<% end %>
<%= f.actions do %>
<%= f.action :submit, :as => :input %>
<% end %>
<% end %>

View File

@@ -0,0 +1,6 @@
<h1>Editing fetznedition</h1>
<%= render 'form' %>
<%= link_to 'Show', @fetznedition %> |
<%= link_to 'Back', fetzneditions_path %>

View File

@@ -0,0 +1,29 @@
<h1>Listing fetzneditions</h1>
<table>
<tr>
<th>Title</th>
<th>Desc</th>
<th>Datum</th>
<th>Datei</th>
<th></th>
<th></th>
<th></th>
</tr>
<% @fetzneditions.each do |fetznedition| %>
<tr>
<td><%= fetznedition.title %></td>
<td><%= fetznedition.desc %></td>
<td><%= fetznedition.datum %></td>
<td><%= fetznedition.datei %></td>
<td><%= link_to 'Show', fetznedition %></td>
<td><%= link_to 'Edit', edit_fetznedition_path(fetznedition) %></td>
<td><%= link_to 'Destroy', fetznedition, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'New Fetznedition', new_fetznedition_path %>

View File

@@ -0,0 +1,5 @@
<h1>New fetznedition</h1>
<%= render 'form' %>
<%= link_to 'Back', fetzneditions_path %>

View File

@@ -0,0 +1,25 @@
<p id="notice"><%= notice %></p>
<p>
<b>Title:</b>
<%= @fetznedition.title %>
</p>
<p>
<b>Desc:</b>
<%= @fetznedition.desc %>
</p>
<p>
<b>Datum:</b>
<%= @fetznedition.datum %>
</p>
<p>
<b>Datei:</b>
<%= @fetznedition.datei %>
</p>
<%= link_to 'Edit', edit_fetznedition_path(@fetznedition) %> |
<%= link_to 'Back', fetzneditions_path %>