Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## events_controller - update
- def update
- @event = Event.find(params[:id])
- if @event.update_attributes(params[:event])
- flash[:notice] = 'Event was successfully updated.'
- redirect_to(pub_event_management_path) and return if @event.event_owner_type == "Pub"
- redirect_to(send("#{@event.event_owner_type.underscore}_event_management_path", @event.event_owner))
- else
- @event.errors.add(:event, "ERROR!")
- redirect_to pub_edit_event_path(@event) and return if @event.event_owner_type == "Pub"
- redirect_to(send("#{@event.event_owner_type.underscore}_edit_event_path", @event.event_owner))
- end
- end
Add Comment
Please, Sign In to add comment