Class: GroupsController

Inherits:
ReaderActionController show all
Defined in:
app/controllers/groups_controller.rb

Instance Method Summary collapse

Methods inherited from ReaderActionController

#default_welcome_url, #logged_in?, #logged_in_admin?, #logged_in_user?, #permission_denied

Instance Method Details

#indexObject



8
9
# File 'app/controllers/groups_controller.rb', line 8

def index
end

#showObject



11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/controllers/groups_controller.rb', line 11

def show
  @readers = @group.readers.uniq
  respond_to do |format|
    format.html
    format.csv {
      send_data Reader.csv_for(@readers), :type => 'text/csv; charset=utf-8; header=present', :filename => "#{@group.filename}.csv"
    }
    format.vcard {
      send_data Reader.vcards_for(@readers), :filename => "everyone.vcf"
    }
  end
end