blob: 6a77f7f4519dde3f8f2f7f8fcb6b60fc118e9b5a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
class ExportsController < ChouetteController
respond_to :html, :xml, :json
respond_to :zip, :only => :show
belongs_to :referential
def create
create! do |success, failure|
success.html { redirect_to referential_exports_path(@referential) }
end
end
def show
show! do |format|
format.zip { send_file @export.file, :type => :zip }
end
end
protected
# FIXME why #resource_id is nil ??
def build_resource
super.tap do |export|
export.referential_id = @referential.id
end
end
def collection
@exports ||= end_of_association_chain.paginate(:page => params[:page])
end
end
|