spud_inquiries 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
data/app/models/spud_inquiry.rb
CHANGED
@@ -4,4 +4,6 @@ class SpudInquiry < ActiveRecord::Base
|
|
4
4
|
belongs_to :spud_inquiry_form
|
5
5
|
accepts_nested_attributes_for :spud_inquiry_fields, :reject_if => lambda { |a| a[:name].blank? }
|
6
6
|
validates :email,:presence => true
|
7
|
+
|
8
|
+
attr_accessible :spud_inquiry_form_id,:email,:spud_inquiry_fields
|
7
9
|
end
|
@@ -7,6 +7,7 @@ class SpudInquiryForm < ActiveRecord::Base
|
|
7
7
|
validates :name,:presence => true,:uniqueness => true
|
8
8
|
validates :url_name,:presence => true, :uniqueness => true
|
9
9
|
before_validation :generate_url_name
|
10
|
+
attr_accessible :name,:url_name,:recipients,:content,:subject,:spud_inquiry_form_fields_attributes
|
10
11
|
|
11
12
|
def generate_url_name
|
12
13
|
self.url_name = self.name.gsub(/[^a-zA-Z0-9\ ]/," ").gsub(/\ \ +/," ").gsub(/\ /,"-").downcase
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<h2><%=@inquiry_form.name%></h2>
|
2
2
|
<%=@inquiry_form.content.html_safe if !@inquiry_form.content.blank?%>
|
3
3
|
|
4
|
-
<%=form_for :spud_inquiry, :url => "/contact/inquire" do |f|%>
|
4
|
+
<%=form_for :spud_inquiry, :url => "/contact/inquire",:html => {:class => "form-horizontal"} do |f|%>
|
5
5
|
<%=error_messages_for(@inquiry)%>
|
6
6
|
<fieldset>
|
7
7
|
<%=f.hidden_field :spud_inquiry_form_id,:value => @inquiry_form.id%>
|
@@ -22,19 +22,19 @@
|
|
22
22
|
when '1'
|
23
23
|
f.check_box field.name,:value => params[:spud_inquiry].blank? || params[:spud_inquiry][field.name].blank? ? field.default_value : params[:spud_inquiry][field.name]
|
24
24
|
when '2'
|
25
|
-
f.text_area field.name,:value => params[:spud_inquiry].blank? || params[:spud_inquiry][field.name].blank? ? field.default_value : params[:spud_inquiry][field.name]
|
25
|
+
f.text_area field.name,:value => params[:spud_inquiry].blank? || params[:spud_inquiry][field.name].blank? ? field.default_value : params[:spud_inquiry][field.name],:rows=>5,:cols => 70
|
26
26
|
when '3'
|
27
27
|
f.select field.name,field.options.split(",").collect {|opt| [opt,opt]},:include_blank => true
|
28
28
|
end%>
|
29
29
|
</div>
|
30
30
|
</div>
|
31
31
|
<%end%>
|
32
|
-
<
|
32
|
+
<div class="spud_inquiry_hide">
|
33
33
|
<label id='other_email_label' for='other_email'>Please leave blank:</label>
|
34
34
|
<input type='text' name='other_email' id='other_email'>
|
35
35
|
</div>
|
36
|
-
<
|
37
|
-
|
36
|
+
<div class="form-actions">
|
37
|
+
<%=f.submit "Submit Inquiry",:class => "btn btn-primary"%>
|
38
38
|
</div>
|
39
39
|
|
40
40
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spud_inquiries
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-04-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
|
-
requirement: &
|
16
|
+
requirement: &70153608486180 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 3.2.2
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70153608486180
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: spud_core
|
27
|
-
requirement: &
|
27
|
+
requirement: &70153609319680 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -35,10 +35,10 @@ dependencies:
|
|
35
35
|
version: 0.9.0
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
|
-
version_requirements: *
|
38
|
+
version_requirements: *70153609319680
|
39
39
|
- !ruby/object:Gem::Dependency
|
40
40
|
name: mysql2
|
41
|
-
requirement: &
|
41
|
+
requirement: &70153609319020 !ruby/object:Gem::Requirement
|
42
42
|
none: false
|
43
43
|
requirements:
|
44
44
|
- - ! '>='
|
@@ -46,10 +46,10 @@ dependencies:
|
|
46
46
|
version: '0'
|
47
47
|
type: :development
|
48
48
|
prerelease: false
|
49
|
-
version_requirements: *
|
49
|
+
version_requirements: *70153609319020
|
50
50
|
- !ruby/object:Gem::Dependency
|
51
51
|
name: rspec
|
52
|
-
requirement: &
|
52
|
+
requirement: &70153609318560 !ruby/object:Gem::Requirement
|
53
53
|
none: false
|
54
54
|
requirements:
|
55
55
|
- - ! '>='
|
@@ -57,10 +57,10 @@ dependencies:
|
|
57
57
|
version: '0'
|
58
58
|
type: :development
|
59
59
|
prerelease: false
|
60
|
-
version_requirements: *
|
60
|
+
version_requirements: *70153609318560
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: rspec-rails
|
63
|
-
requirement: &
|
63
|
+
requirement: &70153609318140 !ruby/object:Gem::Requirement
|
64
64
|
none: false
|
65
65
|
requirements:
|
66
66
|
- - ! '>='
|
@@ -68,10 +68,10 @@ dependencies:
|
|
68
68
|
version: '0'
|
69
69
|
type: :development
|
70
70
|
prerelease: false
|
71
|
-
version_requirements: *
|
71
|
+
version_requirements: *70153609318140
|
72
72
|
- !ruby/object:Gem::Dependency
|
73
73
|
name: factory_girl
|
74
|
-
requirement: &
|
74
|
+
requirement: &70153609317640 !ruby/object:Gem::Requirement
|
75
75
|
none: false
|
76
76
|
requirements:
|
77
77
|
- - =
|
@@ -79,10 +79,10 @@ dependencies:
|
|
79
79
|
version: 2.5.0
|
80
80
|
type: :development
|
81
81
|
prerelease: false
|
82
|
-
version_requirements: *
|
82
|
+
version_requirements: *70153609317640
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: mocha
|
85
|
-
requirement: &
|
85
|
+
requirement: &70153609317140 !ruby/object:Gem::Requirement
|
86
86
|
none: false
|
87
87
|
requirements:
|
88
88
|
- - =
|
@@ -90,10 +90,10 @@ dependencies:
|
|
90
90
|
version: 0.10.3
|
91
91
|
type: :development
|
92
92
|
prerelease: false
|
93
|
-
version_requirements: *
|
93
|
+
version_requirements: *70153609317140
|
94
94
|
- !ruby/object:Gem::Dependency
|
95
95
|
name: database_cleaner
|
96
|
-
requirement: &
|
96
|
+
requirement: &70153609316680 !ruby/object:Gem::Requirement
|
97
97
|
none: false
|
98
98
|
requirements:
|
99
99
|
- - =
|
@@ -101,7 +101,7 @@ dependencies:
|
|
101
101
|
version: 0.7.1
|
102
102
|
type: :development
|
103
103
|
prerelease: false
|
104
|
-
version_requirements: *
|
104
|
+
version_requirements: *70153609316680
|
105
105
|
description: This gem allows you to build forms for user submission and can send email
|
106
106
|
notifications when a form is filled out.
|
107
107
|
email:
|
@@ -197,7 +197,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
197
197
|
version: '0'
|
198
198
|
segments:
|
199
199
|
- 0
|
200
|
-
hash: -
|
200
|
+
hash: -1474236751689464196
|
201
201
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
202
202
|
none: false
|
203
203
|
requirements:
|
@@ -206,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
206
206
|
version: '0'
|
207
207
|
segments:
|
208
208
|
- 0
|
209
|
-
hash: -
|
209
|
+
hash: -1474236751689464196
|
210
210
|
requirements: []
|
211
211
|
rubyforge_project:
|
212
212
|
rubygems_version: 1.8.15
|