diff options
| author | hukl <contact@smyck.org> | 2009-04-18 14:23:02 +0200 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-04-18 14:23:02 +0200 |
| commit | 1a80d6cd79235694cc8babf8dc779be3155c9111 (patch) | |
| tree | 4bea63bf7db094de8ca6027e9af45e371e4d865c /app/controllers/events_controller.rb | |
| parent | 51797bf2b5f86d14139ba985e9c777fa0160af46 (diff) | |
adding event information to the metadata section allowing to add and edit events
Diffstat (limited to 'app/controllers/events_controller.rb')
| -rw-r--r-- | app/controllers/events_controller.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/events_controller.rb b/app/controllers/events_controller.rb index c25c73f..04e9908 100644 --- a/app/controllers/events_controller.rb +++ b/app/controllers/events_controller.rb | |||
| @@ -24,7 +24,7 @@ class EventsController < ApplicationController | |||
| 24 | # GET /events/new | 24 | # GET /events/new |
| 25 | # GET /events/new.xml | 25 | # GET /events/new.xml |
| 26 | def new | 26 | def new |
| 27 | @event = Event.new | 27 | @event = Event.new(:node_id => params[:node_id]) |
| 28 | 28 | ||
| 29 | respond_to do |format| | 29 | respond_to do |format| |
| 30 | format.html # new.html.erb | 30 | format.html # new.html.erb |
| @@ -45,7 +45,7 @@ class EventsController < ApplicationController | |||
| 45 | respond_to do |format| | 45 | respond_to do |format| |
| 46 | if @event.save | 46 | if @event.save |
| 47 | flash[:notice] = 'Event was successfully created.' | 47 | flash[:notice] = 'Event was successfully created.' |
| 48 | format.html { redirect_to(@event) } | 48 | format.html { redirect_to(edit_node_path(@event.node)) } |
| 49 | format.xml { render :xml => @event, :status => :created, :location => @event } | 49 | format.xml { render :xml => @event, :status => :created, :location => @event } |
| 50 | else | 50 | else |
| 51 | format.html { render :action => "new" } | 51 | format.html { render :action => "new" } |
| @@ -62,7 +62,7 @@ class EventsController < ApplicationController | |||
| 62 | respond_to do |format| | 62 | respond_to do |format| |
| 63 | if @event.update_attributes(params[:event]) | 63 | if @event.update_attributes(params[:event]) |
| 64 | flash[:notice] = 'Event was successfully updated.' | 64 | flash[:notice] = 'Event was successfully updated.' |
| 65 | format.html { redirect_to(@event) } | 65 | format.html { redirect_to(edit_node_path(@event.node)) } |
| 66 | format.xml { head :ok } | 66 | format.xml { head :ok } |
| 67 | else | 67 | else |
| 68 | format.html { render :action => "edit" } | 68 | format.html { render :action => "edit" } |
