class WayController < ApplicationController
require 'xml/libxml'
- before_filter :authorize, :only => [:create, :update, :destroy]
+ session :off
+ before_filter :authorize, :only => [:create, :update, :delete]
+ before_filter :check_availability, :only => [:create, :update, :delete]
after_filter :compress_output
def create
way.user_id = @user.id
way.tags = new_way.tags
way.segs = new_way.segs
- way.timestamp = new_way.timestamp
way.visible = true
if way.save_with_history
if way.visible
way.user_id = @user.id
+ way.tags = []
+ way.segs = []
way.visible = false
if way.save_with_history
end
def ways
- ids = params['ways'].split(',').collect { |w| w.to_i }
+ begin
+ ids = params['ways'].split(',').collect { |w| w.to_i }
+ rescue
+ ids = []
+ end
if ids.length > 0
doc = OSM::API.new.get_xml_doc