On Fri, 2011-08-19 at 15:42 +0300, [email protected] wrote:
> +#get html form for creating a new blob
> +get "#{Sinatra::UrlForHelper::DEFAULT_URI_PREFIX}/buckets/:bucket/new_blob"
> do
> + @bucket_id = params[:bucket]
> + respond_to do |format|
> + format.html {haml :"blobs/new"}
> + end
> +end
Doesn't this mean that if somebody has a blob called 'new_blob' and they
try to get the XML representation, they'll get nothing ?
It would be better to do the following in the /buckets/:bucket/:blob
route:
respond_to do
...
format.html do
templ = params[:blob] == "new_blob" ? "blobs/new" : "blobs/show"
haml templ.to_sym
end
end
Even better, if we could make the special name to get at the new blob
form something less likely to collide, like
'deltacloud_get_new_html_blob_form' or some such.
David