Module: Roda::RodaPlugins::Assets::RequestMethods

Defined in:
lib/roda/plugins/assets.rb

Instance Method Summary collapse

Instance Method Details

#assetsObject

Render the matching asset if this is a GET request for a supported asset.



887
888
889
890
891
892
893
894
895
896
# File 'lib/roda/plugins/assets.rb', line 887

def assets
  if is_get?
    self.class.assets_matchers.each do |type, matcher|
      is matcher do |file|
        scope.render_asset(file, type)
      end
    end
    nil
  end
end