This repository has been archived on 2023-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
wiki_external_filter/app/controllers/wiki_external_filter_contro...

24 lines
655 B
Ruby
Raw Normal View History

2010-01-11 13:38:44 +01:00
class WikiExternalFilterController < ApplicationController
include WikiExternalFilterHelper
def filter
name = params[:name]
macro = params[:macro]
index = params[:index].to_i
filename = params[:filename] ? params[:filename] : name
2010-01-11 13:38:44 +01:00
config = load_config
cache_key = self.construct_cache_key(macro, name)
2012-08-02 12:09:00 +02:00
content = Rails.cache.read cache_key
Rails.logger.debug "Config:#{config} Key: #{cache_key} Content: #{content}"
2010-01-11 13:38:44 +01:00
if (content)
send_data content[index], :type => config[macro]['outputs'][index]['content_type'], :disposition => 'inline', :filename => filename
2010-01-11 13:38:44 +01:00
else
render_404
end
end
end