forked from bofh/fetsite
Verbesserung im moduls_controller
This commit is contained in:
@@ -68,7 +68,7 @@ class ModulsController < ApplicationController
|
|||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @modul.update_attributes(params[:modul])
|
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 }
|
format.json { head :no_content }
|
||||||
else
|
else
|
||||||
format.html { render action: "edit" }
|
format.html { render action: "edit" }
|
||||||
@@ -80,11 +80,13 @@ class ModulsController < ApplicationController
|
|||||||
# DELETE /moduls/1
|
# DELETE /moduls/1
|
||||||
# DELETE /moduls/1.json
|
# DELETE /moduls/1.json
|
||||||
def destroy
|
def destroy
|
||||||
|
|
||||||
@modul = Modul.find(params[:id])
|
@modul = Modul.find(params[:id])
|
||||||
|
modulgruppe=@modul.modulgruppen.first
|
||||||
@modul.destroy
|
@modul.destroy
|
||||||
|
|
||||||
|
|
||||||
redirect_to moduls_path()
|
redirect_to modulgruppe_path(modulgruppe)
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,5 +2,6 @@ class Neuigkeit < ActiveRecord::Base
|
|||||||
attr_accessible :datum, :text, :title, :rubrik_id
|
attr_accessible :datum, :text, :title, :rubrik_id
|
||||||
belongs_to :author, :class_name =>'User'
|
belongs_to :author, :class_name =>'User'
|
||||||
belongs_to :rubrik, :class_name =>'Rubrik', :foreign_key => "rubrik_id"
|
belongs_to :rubrik, :class_name =>'Rubrik', :foreign_key => "rubrik_id"
|
||||||
|
validates :rubrik, :presence=>true
|
||||||
|
validates :author, :presence=>true
|
||||||
end
|
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
|
# Don't care if the mailer can't send
|
||||||
config.action_mailer.raise_delivery_errors = false
|
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
|
# Print deprecation notices to the Rails logger
|
||||||
config.active_support.deprecation = :log
|
config.active_support.deprecation = :log
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ Devise.setup do |config|
|
|||||||
|
|
||||||
# Configure the class responsible to send e-mails.
|
# Configure the class responsible to send e-mails.
|
||||||
# config.mailer = "Devise::Mailer"
|
# 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.delivery_method = :sendmail
|
||||||
# config.mailer.smtp_settings = {
|
# config.mailer.smtp_settings = {
|
||||||
# :address => "smtp.gmail.com",
|
# :address => "smtp.gmail.com",
|
||||||
|
|||||||
Reference in New Issue
Block a user