before_action :check_api_readable, :except => [:create, :update, :delete]
around_action :api_call_handle_error, :api_call_timeout
+ before_action :set_request_formats, :except => [:create, :update, :delete]
+
def create
assert_method :put
end
def show
- way = Way.find(params[:id])
+ @way = Way.find(params[:id])
- response.last_modified = way.timestamp
-
- if way.visible
- @way = way
+ response.last_modified = @way.timestamp
+ if @way.visible
# Render the result
respond_to do |format|
format.xml
+ format.json
end
else
head :gone
end
def full
- way = Way.includes(:nodes => :node_tags).find(params[:id])
+ @way = Way.includes(:nodes => :node_tags).find(params[:id])
- if way.visible
+ if @way.visible
visible_nodes = {}
- # changeset_cache = {}
- # user_display_name_cache = {}
@nodes = []
- way.nodes.uniq.each do |node|
+ @way.nodes.uniq.each do |node|
if node.visible
@nodes << node
visible_nodes[node.id] = node
end
end
- @way = way
-
# Render the result
respond_to do |format|
format.xml
+ format.json
end
else
head :gone
# Render the result
respond_to do |format|
format.xml
+ format.json
end
end
# Render the result
respond_to do |format|
format.xml
+ format.json
end
end
end