Merge branch 'master' of https://github.com/fetsite/fetsite
This commit is contained in:
@@ -27,6 +27,7 @@ class NeuigkeitenController < ApplicationController
|
||||
def create
|
||||
@neuigkeit = Neuigkeit.new(params[:neuigkeit])
|
||||
@rubrik = @neuigkeit.rubrik
|
||||
|
||||
respond_to do |format|
|
||||
if @neuigkeit.save
|
||||
format.html { redirect_to @neuigkeit, notice: 'Neuigkeit was successfully created.' }
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#
|
||||
|
||||
class Neuigkeit < ActiveRecord::Base
|
||||
attr_accessible :datum, :text, :title, :rubrik_id
|
||||
attr_accessible :datum, :text, :title, :rubrik_id, :author_id
|
||||
belongs_to :author, :class_name =>'User'
|
||||
belongs_to :rubrik, :class_name =>'Rubrik', :foreign_key => "rubrik_id"
|
||||
validates :rubrik, :presence=>true
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
<%= f.input :text, :as=>:tinymce_text %>
|
||||
<%= f.input :datum %>
|
||||
<%= f.input :rubrik, :as=>:radio, :collection=>Rubrik.all %>
|
||||
<%= f.input :author, :as=>:radio %>
|
||||
<% end %>
|
||||
|
||||
<%= f.actions do %>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<h2><%= link_to neuigkeit.title,neuigkeit_path(neuigkeit) %></h2>
|
||||
<%= if !neuigkeit.author.nil?
|
||||
neuigkeit.author.name
|
||||
neuigkeit.author.email
|
||||
end %>
|
||||
<p><%= raw(neuigkeit.text) %></p>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<h1>Editing neuigkeit</h1>
|
||||
|
||||
<%= %>
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Show', @neuigkeit %> |
|
||||
|
||||
Reference in New Issue
Block a user