diff --git a/app/controllers/moduls_controller.rb b/app/controllers/moduls_controller.rb index 410d6f7..689a71e 100644 --- a/app/controllers/moduls_controller.rb +++ b/app/controllers/moduls_controller.rb @@ -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 diff --git a/app/models/neuigkeit.rb b/app/models/neuigkeit.rb index 39dfbe8..c03e526 100644 --- a/app/models/neuigkeit.rb +++ b/app/models/neuigkeit.rb @@ -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 diff --git a/app/views/home/dev.html.erb b/app/views/home/dev.html.erb new file mode 100644 index 0000000..63063a6 --- /dev/null +++ b/app/views/home/dev.html.erb @@ -0,0 +1,12 @@ +

Entwicklungsprojekt

+

Testfeatures

+Neuigkeiten +

+Dieses Feature soll aktuelle Informationen zu verschiedenen Themen verwalten und zur Verfügung stellen. +Dementsprechen muss auch darauf Rücksicht genommen werden. +

+

Wichtige Punkte die noch entwickelt werden sind:

+

<%= link_to "Neuigkeiten", rubriken_path %>

+ +

Wiki Funktionalitär

+

<%= link_to "Wiki", page_path(Page.find(1)) %>

diff --git a/app/views/pages/show.html.erb b/app/views/pages/show.html.erb new file mode 100644 index 0000000..bf7bdfa --- /dev/null +++ b/app/views/pages/show.html.erb @@ -0,0 +1,9 @@ +<%= breadcrumbs(@page) %> +
+

<%= @page.name %>

+<%= raw(@page.content)%> +
+<%= link_to '(Edit)', edit_page_path(@page)%> +<%= link_to '(Destroy)', @page, :remote => true, :confirm => 'Are you sure?', :method => :delete + +%> diff --git a/config/environments/development.rb b/config/environments/development.rb index 1ac917a..583fc8b 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -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 diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 6fabeb3..765c261 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -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",