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?
|
@rubrik=Rubrik.find(params[:rubrik_id]) unless params[:rubrik_id].nil?
|
||||||
@neuigkeit.rubrik=@rubrik unless @rubrik.nil?
|
@neuigkeit.rubrik=@rubrik unless @rubrik.nil?
|
||||||
end
|
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
|
def unpublish
|
||||||
@neuigkeit = Neuigkeit.find(params[:id])
|
@neuigkeit = Neuigkeit.find(params[:id])
|
||||||
@neuigkeit.reverse_publish
|
@neuigkeit.reverse_publish
|
||||||
|
|||||||
@@ -7,6 +7,11 @@
|
|||||||
<%= f.input :rubrik, :as=>:radio, :collection=>Rubrik.all %>
|
<%= f.input :rubrik, :as=>:radio, :collection=>Rubrik.all %>
|
||||||
<%= f.input :author, :as=>:radio %>
|
<%= f.input :author, :as=>:radio %>
|
||||||
<%= f.input :picture, :as=>:file %>
|
<%= 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 %>
|
<% end %>
|
||||||
|
|
||||||
<%= f.actions do %>
|
<%= f.actions do %>
|
||||||
|
|||||||
@@ -69,6 +69,8 @@
|
|||||||
member do
|
member do
|
||||||
get 'publish'
|
get 'publish'
|
||||||
get 'unpublish'
|
get 'unpublish'
|
||||||
|
get 'add_calentry'
|
||||||
|
get 'rm_calentry'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user