Beispiele hinzugefügt

This commit is contained in:
Andreas Stephanides
2013-02-15 10:48:52 +01:00
parent 154e338360
commit 19b4ed31f4
23 changed files with 305 additions and 19 deletions

View File

@@ -0,0 +1,12 @@
<%= semantic_form_for @beispiel, :html => { :multipart => true } do |f| %>
<%= f.inputs do %>
<%= f.input :name %>
<%= f.input :desc %>
<%= f.input :file , :as=>:file %>
<%= f.input :lva, :as=>:radio, :collection => Lva.all%>
<% end %>
<%= f.actions do %>
<%= f.action :submit, :as => :input %>
<% end %>
<% end %>

View File

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

View File

@@ -0,0 +1,25 @@
<h1>Listing beispiele</h1>
<table>
<tr>
<th>Name</th>
<th>Desc</th>
<th></th>
<th></th>
<th></th>
</tr>
<% @beispiele.each do |beispiel| %>
<tr>
<td><%= beispiel.name %></td>
<td><%= beispiel.desc %></td>
<td><%= link_to 'Show', beispiel %></td>
<td><%= link_to 'Edit', edit_beispiel_path(beispiel) %></td>
<td><%= link_to 'Destroy', beispiel, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'New Beispiel', new_beispiel_path %>

View File

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

View File

@@ -0,0 +1,16 @@
<p id="notice"><%= notice %></p>
<p>
<b>Name:</b>
<%= @beispiel.name %>
</p>
<p>
<b>Desc:</b>
<%= @beispiel.desc %>
<%= @beispiel.file.url %>
</p>
<%= link_to 'Edit', edit_beispiel_path(@beispiel) %> |
<%= link_to 'Back', beispiele_path %>