forked from bofh/fetsite
neuigkeiten small fix
This commit is contained in:
@@ -27,6 +27,18 @@ class NeuigkeitenController < ApplicationController
|
||||
@rubrik=Rubrik.find(params[:rubrik_id]) unless params[:rubrik_id].nil?
|
||||
@neuigkeit.rubrik=@rubrik unless @rubrik.nil?
|
||||
end
|
||||
def add_calentry
|
||||
@neuigkeit=Neuigkeit.find(params[:id])
|
||||
if params[:calentry_id].nil?
|
||||
ce = Calentry.new
|
||||
else
|
||||
ce=Calentry.find(params[:calentry_id])
|
||||
end
|
||||
@calentry=ce
|
||||
ce.object=@neuigkeit
|
||||
render 'edit'
|
||||
end
|
||||
|
||||
def unpublish
|
||||
@neuigkeit = Neuigkeit.find(params[:id])
|
||||
@neuigkeit.reverse_publish
|
||||
|
||||
@@ -7,6 +7,11 @@
|
||||
<%= f.input :rubrik, :as=>:radio, :collection=>Rubrik.all %>
|
||||
<%= f.input :author, :as=>:radio %>
|
||||
<%= f.input :picture, :as=>:file %>
|
||||
<%= f.inputs :for => :calentry do |calentry| %>
|
||||
<%= calentry.input :start, :as =>:datepicker %>
|
||||
<%= calentry.input :ende, :as =>:datepicker %>
|
||||
<%= calentry.input :typ %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<%= f.actions do %>
|
||||
|
||||
@@ -69,6 +69,8 @@
|
||||
member do
|
||||
get 'publish'
|
||||
get 'unpublish'
|
||||
get 'add_calentry'
|
||||
get 'rm_calentry'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user