forked from bofh/fetsite
FIXES:
* Inflections für Thema/Themen etc. * Korrigierte Views
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
class Frage < ActiveRecord::Base
|
||||
has_paper_trail
|
||||
attr_accessible :text, :title
|
||||
belongs_to :thema
|
||||
|
||||
validates :thema, :presence => true
|
||||
validates :title, :prescece => true
|
||||
validates :title, :presence => true
|
||||
|
||||
translates :title,:text, :versioning =>true, :fallbacks_for_empty_translations => true
|
||||
end
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
class Frage < ActiveRecord::Base
|
||||
has_paper_trail
|
||||
attr_accessible :text, :title
|
||||
belongs_to :thema
|
||||
|
||||
validates :thema, :presence => true
|
||||
validates :title, :presence => true
|
||||
|
||||
translates :title,:text, :versioning =>true, :fallbacks_for_empty_translations => true
|
||||
end
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
class Thema < ActiveRecord::Base
|
||||
has_paper_trail
|
||||
attr_accessible :text, :title
|
||||
has_many :fragen
|
||||
has_many :attachments
|
||||
belongs_to :themengruppe
|
||||
belongs_to :themengruppe, :foreign_key => "themengruppe_id"
|
||||
|
||||
validates :themengruppe, :presence => true
|
||||
validates :title, :presence => true
|
||||
|
||||
translates :title,:text, :versioning =>true, :fallbacks_for_empty_translations => true
|
||||
end
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
class Thema < ActiveRecord::Base
|
||||
attr_accessible :text, :title
|
||||
has_many :fragen
|
||||
has_many :attachments
|
||||
belongs_to :themengruppe
|
||||
|
||||
validates :themengruppe, :presence => true
|
||||
validates :title, :presence => true
|
||||
|
||||
translates :title,:text, :versioning =>true, :fallbacks_for_empty_translations => true
|
||||
end
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
class Themengruppe < ActiveRecord::Base
|
||||
has_paper_trail
|
||||
attr_accessible :text, :title
|
||||
has_many :themen
|
||||
has_many :fragen, through: :themen
|
||||
|
||||
validates :title, :presence => true
|
||||
|
||||
translates :title,:text, :versioning =>true, :fallbacks_for_empty_translations => true
|
||||
end
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
class Themengruppe < ActiveRecord::Base
|
||||
has_paper_trail
|
||||
attr_accessible :text, :title
|
||||
has_many :themen
|
||||
has_many :fragen, through: :themen
|
||||
|
||||
validates :title, :presence => true
|
||||
end
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<p>
|
||||
<b>Title:</b>
|
||||
<h1>
|
||||
<%= @frage.title %>
|
||||
</p>
|
||||
</h1>
|
||||
|
||||
<p>
|
||||
<b>Text:</b>
|
||||
<%= @frage.text %>
|
||||
</p>
|
||||
|
||||
|
||||
15
app/views/fragen/show.html.erb~
Normal file
15
app/views/fragen/show.html.erb~
Normal file
@@ -0,0 +1,15 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<p>
|
||||
<b>Title:</b>
|
||||
<%= @frage.title %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Text:</b>
|
||||
<%= @frage.text %>
|
||||
</p>
|
||||
|
||||
|
||||
<%= link_to 'Edit', edit_frage_path(@frage) %> |
|
||||
<%= link_to 'Back', fragen_path %>
|
||||
@@ -9,17 +9,17 @@
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
<% @themengruppen.each do |themagruppen| %>
|
||||
<% @themengruppen.each do |themengruppe| %>
|
||||
<tr>
|
||||
<td><%= themagruppen.title %></td>
|
||||
<td><%= themagruppen.text %></td>
|
||||
<td><%= link_to 'Show', themagruppen %></td>
|
||||
<td><%= link_to 'Edit', edit_themagruppen_path(themagruppen) %></td>
|
||||
<td><%= link_to 'Destroy', themagruppen, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
<td><%= themengruppe.title %></td>
|
||||
<td><%= themengruppe.text %></td>
|
||||
<td><%= link_to 'Show', themengruppe %></td>
|
||||
<td><%= link_to 'Edit', edit_themengruppe_path(themengruppe) %></td>
|
||||
<td><%= link_to 'Destroy', themengruppe, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<br />
|
||||
|
||||
<%= link_to 'New Themengruppe', new_themagruppen_path %>
|
||||
<%= link_to 'New Themengruppe', new_themengruppe_path %>
|
||||
|
||||
25
app/views/themengruppen/index.html.erb~
Normal file
25
app/views/themengruppen/index.html.erb~
Normal file
@@ -0,0 +1,25 @@
|
||||
<h1>Listing themengruppen</h1>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Title</th>
|
||||
<th>Text</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
<% @themengruppen.each do |themagruppen| %>
|
||||
<tr>
|
||||
<td><%= themagruppen.title %></td>
|
||||
<td><%= themagruppen.text %></td>
|
||||
<td><%= link_to 'Show', themagruppen %></td>
|
||||
<td><%= link_to 'Edit', edit_themagruppen_path(themagruppen) %></td>
|
||||
<td><%= link_to 'Destroy', themagruppen, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<br />
|
||||
|
||||
<%= link_to 'New Themengruppe', new_themagruppen_path %>
|
||||
Reference in New Issue
Block a user