My favorites
▼
|
Sign in
substruct
Open-source Ruby on Rails E-Commerce
Project Home
Downloads
Wiki
Issues
Source
READ-ONLY: This project has been
archived
. For more information see
this post
.
Search
Search within:
All issues
Open issues
New issues
Issues to verify
for
Advanced search
Search tips
Subscriptions
Issue
91
attachment: validate_when_sending_questions.patch
(3.1 KB)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Index: /home/edmundo/workspace_aptana/trunk/vendor/plugins/substruct/app/models/question.rb
===================================================================
--- /home/edmundo/workspace_aptana/trunk/vendor/plugins/substruct/app/models/question.rb (revision 78)
+++ /home/edmundo/workspace_aptana/trunk/vendor/plugins/substruct/app/models/question.rb (working copy)
@@ -1,4 +1,6 @@
class Question < ActiveRecord::Base
# Validation
validates_presence_of :short_question, :message => ERROR_EMPTY
+ validates_presence_of :long_question, :message => ERROR_EMPTY
+ validates_presence_of :email_address, :message => ERROR_EMPTY
end
Index: /home/edmundo/workspace_aptana/trunk/vendor/plugins/substruct/app/controllers/questions_controller.rb
===================================================================
--- /home/edmundo/workspace_aptana/trunk/vendor/plugins/substruct/app/controllers/questions_controller.rb (revision 78)
+++ /home/edmundo/workspace_aptana/trunk/vendor/plugins/substruct/app/controllers/questions_controller.rb (working copy)
@@ -22,7 +22,8 @@
@question = Question.new(params[:question])
@question.short_question = "Message from the contact form"
if !@question.save then
- render :action => 'new'
+ flash.now[:notice] = 'There were some problems with the information you entered.<br/><br/>Please look at the fields below.'
+ render :action => 'ask'
end
end
Index: /home/edmundo/workspace_aptana/trunk/vendor/plugins/substruct/app/views/questions/ask.rhtml
===================================================================
--- /home/edmundo/workspace_aptana/trunk/vendor/plugins/substruct/app/views/questions/ask.rhtml (revision 78)
+++ /home/edmundo/workspace_aptana/trunk/vendor/plugins/substruct/app/views/questions/ask.rhtml (working copy)
@@ -9,13 +9,25 @@
<%= form_tag :action => 'send_question' %>
- <p><label for="question_email_address">Your Email Address</label>
- <%= text_field 'question', 'email_address', :size => 50, :maxlength => 50, :class => 'textInput' %>
+ <div style="padding-bottom:10px;">
+ <%= make_label("Your Email Address", true) %>
+ <%= text_field 'question', 'email_address', :size => 50, :maxlength => 50, :class => 'textInput' %>
+ <%= error_message_on(:question, :email_address) %>
+ <br/>
+ <span class="info">We won't ever sell, spam or share your email address.</span>
+ </div>
- <p><label for="question_long_question">Question</label>
- <%= text_area 'question', 'long_question', :cols => 60, :rows => 8, :class => 'textArea' %></p>
+ <div style="padding-bottom:10px;">
+ <%= make_label("Question", true) %>
+ <%= text_area 'question', 'long_question', :cols => 60, :rows => 8, :class => 'textArea' %>
+ <%= error_message_on(:question, :long_question) %>
+ </div>
- <%= submit_tag "Send your question to us", :class => 'button twohundred' %>
+ <div class="clear"> </div>
+ <p>
+ <%= submit_tag "Send your question to us", :class => 'button' %>
+ <div class="clear"> </div>
+ </p>
</form>
</div>
Powered by
Google Project Hosting