Verbesserung im moduls_controller
This commit is contained in:
@@ -68,7 +68,7 @@ class ModulsController < ApplicationController
|
||||
|
||||
respond_to do |format|
|
||||
if @modul.update_attributes(params[:modul])
|
||||
format.html { redirect_to @modul, notice: 'Modul was successfully updated.' }
|
||||
format.html { redirect_to modul_path(@modul), notice: 'Modul was successfully updated.' }
|
||||
format.json { head :no_content }
|
||||
else
|
||||
format.html { render action: "edit" }
|
||||
@@ -80,11 +80,13 @@ class ModulsController < ApplicationController
|
||||
# DELETE /moduls/1
|
||||
# DELETE /moduls/1.json
|
||||
def destroy
|
||||
|
||||
@modul = Modul.find(params[:id])
|
||||
modulgruppe=@modul.modulgruppen.first
|
||||
@modul.destroy
|
||||
|
||||
|
||||
redirect_to moduls_path()
|
||||
redirect_to modulgruppe_path(modulgruppe)
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2,5 +2,6 @@ class Neuigkeit < ActiveRecord::Base
|
||||
attr_accessible :datum, :text, :title, :rubrik_id
|
||||
belongs_to :author, :class_name =>'User'
|
||||
belongs_to :rubrik, :class_name =>'Rubrik', :foreign_key => "rubrik_id"
|
||||
|
||||
validates :rubrik, :presence=>true
|
||||
validates :author, :presence=>true
|
||||
end
|
||||
|
||||
12
app/views/home/dev.html.erb
Normal file
12
app/views/home/dev.html.erb
Normal file
@@ -0,0 +1,12 @@
|
||||
<h1>Entwicklungsprojekt</h1>
|
||||
<h2>Testfeatures</h2>
|
||||
<b>Neuigkeiten</b>
|
||||
<p>
|
||||
Dieses Feature soll aktuelle Informationen zu verschiedenen Themen verwalten und zur Verfügung stellen.
|
||||
Dementsprechen muss auch darauf Rücksicht genommen werden.
|
||||
</p>
|
||||
<p>Wichtige Punkte die noch entwickelt werden sind: <ul><li>Verwaltung bestehender Nachrichten</li><li>Facebook Interface</li></ul></p>
|
||||
<p><%= link_to "Neuigkeiten", rubriken_path %></p>
|
||||
|
||||
<p><b>Wiki Funktionalitär</b></p>
|
||||
<p><%= link_to "Wiki", page_path(Page.find(1)) %></p>
|
||||
9
app/views/pages/show.html.erb
Normal file
9
app/views/pages/show.html.erb
Normal file
@@ -0,0 +1,9 @@
|
||||
<%= breadcrumbs(@page) %>
|
||||
<hr>
|
||||
<h1><%= @page.name %></h1>
|
||||
<%= raw(@page.content)%>
|
||||
<hr />
|
||||
<%= link_to '(Edit)', edit_page_path(@page)%>
|
||||
<%= link_to '(Destroy)', @page, :remote => true, :confirm => 'Are you sure?', :method => :delete
|
||||
|
||||
%>
|
||||
Reference in New Issue
Block a user