Sha256: f49969ec6872474b3a003e1e1402e5bf9eb6145d1f38a63a83f042ee702c14c4
Contents?: true
Size: 978 Bytes
Versions: 1
Compression:
Stored size: 978 Bytes
Contents
class GroupsController < ReaderActionController helper :reader before_filter :require_reader before_filter :get_group_or_groups before_filter :require_group_visibility, :only => [:show] def index end def show @readers = @group.readers.uniq respond_to do |format| format.html format.csv { send_data generate_csv(@readers), :type => 'text/csv; charset=utf-8; header=present', :filename => "#{@group.filename}.csv" } format.vcard { send_data generate_vcard(@readers), :filename => "#{@group.filename}.vcf" } end end private def get_group_or_groups @groups = Group.roots.visible_to(current_reader) @group = Group.find(params[:id]) if params[:id] end def require_group_visibility if @group && !@group.visible_to?(current_reader) # nb. @groups is a smaller set raise ReaderError::AccessDenied, "That group is not public and you are not in it." end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
radiant-reader-extension-3.0.0 | app/controllers/groups_controller.rb |