forked from bofh/fetsite
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
|
||||
|
||||
%>
|
||||
@@ -15,7 +15,7 @@ Fetsite::Application.configure do
|
||||
|
||||
# Don't care if the mailer can't send
|
||||
config.action_mailer.raise_delivery_errors = false
|
||||
config.action_mailer.default_url_options = { :host => 'localhost:4000' }
|
||||
config.action_mailer.default_url_options = { :host => 'glonass.htu.tuwien.ac.at' }
|
||||
# Print deprecation notices to the Rails logger
|
||||
config.active_support.deprecation = :log
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ Devise.setup do |config|
|
||||
|
||||
# Configure the class responsible to send e-mails.
|
||||
# config.mailer = "Devise::Mailer"
|
||||
config.mailer.default_url_options = { :host => 'localhost:3000' }
|
||||
config.mailer.default_url_options = { :host => 'glonass.htu.tuwien.ac.at' }
|
||||
config.mailer.delivery_method = :sendmail
|
||||
# config.mailer.smtp_settings = {
|
||||
# :address => "smtp.gmail.com",
|
||||
|
||||
Reference in New Issue
Block a user