forked from bofh/fetsite
fetzneditions
This commit is contained in:
3
app/assets/javascripts/fetzneditions.js.coffee
Normal file
3
app/assets/javascripts/fetzneditions.js.coffee
Normal 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/
|
||||
3
app/assets/stylesheets/fetzneditions.css.scss
Normal file
3
app/assets/stylesheets/fetzneditions.css.scss
Normal 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/
|
||||
83
app/controllers/fetzneditions_controller.rb
Normal file
83
app/controllers/fetzneditions_controller.rb
Normal 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
|
||||
2
app/helpers/fetzneditions_helper.rb
Normal file
2
app/helpers/fetzneditions_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module FetzneditionsHelper
|
||||
end
|
||||
3
app/models/fetznedition.rb
Normal file
3
app/models/fetznedition.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
class Fetznedition < ActiveRecord::Base
|
||||
attr_accessible :datei, :datum, :desc, :title
|
||||
end
|
||||
12
app/views/fetzneditions/_form.html.erb
Normal file
12
app/views/fetzneditions/_form.html.erb
Normal 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 %>
|
||||
6
app/views/fetzneditions/edit.html.erb
Normal file
6
app/views/fetzneditions/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<h1>Editing fetznedition</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Show', @fetznedition %> |
|
||||
<%= link_to 'Back', fetzneditions_path %>
|
||||
29
app/views/fetzneditions/index.html.erb
Normal file
29
app/views/fetzneditions/index.html.erb
Normal 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 %>
|
||||
5
app/views/fetzneditions/new.html.erb
Normal file
5
app/views/fetzneditions/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>New fetznedition</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Back', fetzneditions_path %>
|
||||
25
app/views/fetzneditions/show.html.erb
Normal file
25
app/views/fetzneditions/show.html.erb
Normal 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 %>
|
||||
Reference in New Issue
Block a user