Sha256: 4e7bd37dcc6c51fa4de8d65c392b0cfbacd6e01c2c2b7e5eb9b008064c6c794c
Contents?: true
Size: 813 Bytes
Versions: 3
Compression:
Stored size: 813 Bytes
Contents
class AdminData::FeedController < AdminData::BaseController unloadable before_filter :ensure_is_allowed_to_view_feed def index render :text => "Usage: http://localhost:3000/admin_data/feed/<model name>" and return if params[:klasss].blank? begin @klass = AdminData::Util.camelize_constantize(params[:klasss]) @title = "Feeds from admin_data #{@klass.name}" @description = "feeds from AdminData #{@klass.name}" @records = @klass.find(:all, :order => "#{@klass.primary_key} desc", :limit => 100) rescue NameError => e render :text => "No constant was found with name #{params[:klasss]}" and return end end private def ensure_is_allowed_to_view_feed render :text => 'not authorized' unless AdminData::Util.is_allowed_to_view_feed?(self) end end
Version data entries
3 entries across 3 versions & 1 rubygems