Module: Deltacloud::Helpers::Application::SinatraHelper

Defined in:
lib/deltacloud/helpers/deltacloud_helper.rb

Instance Method Summary collapse

Instance Method Details

#check_features(opts = {}) ⇒ Object



337
338
339
# File 'lib/deltacloud/helpers/deltacloud_helper.rb', line 337

def check_features(opts={})
  Sinatra::Rabbit.set :check_features, opts[:for]
end

#new_route_for(route, &block) ⇒ Object



326
327
328
329
330
331
332
333
334
335
# File 'lib/deltacloud/helpers/deltacloud_helper.rb', line 326

def new_route_for(route, &block)
  get '/%s/new' % route.to_s do
    instance_eval(&block) if block_given?
    respond_to do |format|
      format.html do
        haml :"#{route}/new"
      end
    end
  end
end