noodall-form-builder 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,16 +15,15 @@ module Noodall
15
15
 
16
16
  def index
17
17
  if @form.nil?
18
- @responses = Noodall::FormResponse.all
18
+ @responses = Noodall::FormResponse.paginate(:per_page => 1000, :page => params[:page])
19
19
  else
20
- @responses = @form.responses
20
+ @responses = @form.responses.paginate(:per_page => 1000, :page => params[:page])
21
21
  end
22
22
 
23
23
  respond_to do |format|
24
24
  format.html # index.html.erb
25
25
  format.xml { render :xml => @responses }
26
26
 
27
-
28
27
  format.csv do
29
28
  csv_string = Abstracted_CSV_Class.generate do |csv|
30
29
  header_row = @form.fields.map do |field|
@@ -45,7 +44,7 @@ module Noodall
45
44
  csv << response_row
46
45
  end
47
46
  end
48
- send_data csv_string, :filename => "#{@form.title} responses - #{Time.now.to_formatted_s(:db)}.csv",
47
+ send_data csv_string, :filename => "#{@form.title} responses - #{Time.now.to_formatted_s(:db)}-#{@responses.current_page}.csv",
49
48
  :type => 'text/csv',
50
49
  :disposition => 'attachment'
51
50
  end
@@ -2,11 +2,12 @@
2
2
 
3
3
  <ul class="choices">
4
4
 
5
- <li><%= link_to 'Download Responses', noodall_admin_form_form_responses_path(@form, :csv), :class => 'button download', :title => "Download all of these responses." %></li>
5
+ <li><%= link_to 'Download Responses', noodall_admin_form_form_responses_path(@form, :csv, :page => params[:page]), :class => 'button download', :title => "Download all of these responses." %></li>
6
6
 
7
7
  </ul>
8
8
 
9
9
  <div id="content-table">
10
+ <%= will_paginate(@responses) %>
10
11
  <table border="0" cellspacing="0" cellpadding="0" class="content">
11
12
  <thead>
12
13
  <tr>
@@ -45,4 +46,5 @@
45
46
  </tr>
46
47
  </tfoot>
47
48
  </table>
49
+ <%= will_paginate(@responses) %>
48
50
  </div>
@@ -1,5 +1,5 @@
1
1
  module Noodall
2
2
  module FormBuilder
3
- VERSION = "0.5.2"
3
+ VERSION = "0.5.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: noodall-form-builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,11 +11,11 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-03-05 00:00:00.000000000Z
14
+ date: 2012-04-27 00:00:00.000000000Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
18
- requirement: &16811260 !ruby/object:Gem::Requirement
18
+ requirement: &19939460 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ! '>='
@@ -23,10 +23,10 @@ dependencies:
23
23
  version: 1.0.0
24
24
  type: :development
25
25
  prerelease: false
26
- version_requirements: *16811260
26
+ version_requirements: *19939460
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: fastercsv
29
- requirement: &16810760 !ruby/object:Gem::Requirement
29
+ requirement: &19928960 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
32
  - - ! '>='
@@ -34,7 +34,7 @@ dependencies:
34
34
  version: '0'
35
35
  type: :runtime
36
36
  prerelease: false
37
- version_requirements: *16810760
37
+ version_requirements: *19928960
38
38
  description: Functionality for building custom forms
39
39
  email: []
40
40
  executables: []
@@ -176,7 +176,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
176
176
  version: '0'
177
177
  segments:
178
178
  - 0
179
- hash: 1395989031952630568
179
+ hash: 4438999108900047749
180
180
  required_rubygems_version: !ruby/object:Gem::Requirement
181
181
  none: false
182
182
  requirements: