Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

cleanup UI and improve email

  • Loading branch information...
commit 4fd559f36c7072a86f7b131c69b9fce6d2977f70 1 parent 35ebf78
Mike Subelsky authored
4 app/mailers/proposal_mailer.rb
View
@@ -1,5 +1,7 @@
class ProposalMailer < ActionMailer::Base
- default from: "speak@ignitebaltimore.com"
+ speak_addr = "Ignite Baltimore <speak@ignitebaltimore.com>"
+ default from: speak_addr
+ default "reply-to" => speak_addr
def confirmed_email(proposal)
@proposal = proposal
1  app/models/proposal.rb
View
@@ -22,6 +22,7 @@ class Proposal < ActiveRecord::Base
validates_presence_of :title, :description, :email, :bio, :speaker_name, allow_blank: false
validates :description, length: { maximum: 1000 }
validates :bio, length: { maximum: 100 }
+ validates :speaker_name, :title, :email, :phone, :website, length: { maximum: 254 }
before_create :save_hash_code
14 app/views/proposals/_form.html.haml
View
@@ -1,12 +1,12 @@
.span12
= simple_form_for proposal, html: { class: 'form-vertical' }, defaults: { input_html: { class: 'span6' } } do |f|
- = f.input :speaker_name, label: "Your name", required: true
- = f.input :email, label: "Your email address", required: true
- = f.input :title, label: "Title of your talk", required: true
- = f.input :description, label: "Brief description of your talk (1000 characters maximum)", required: true
- = f.input :bio, label: "A one sentence biographical description of your background (100 characters maximum).", required: true
- = f.input :website, label: "Your website URL, if any", required: false
- = f.input :phone, label: "Daytime phone number", required: false
+ = f.input :speaker_name, label: "Your name", required: true, input_html: { maxlength: 254 }
+ = f.input :email, label: "Your email address", required: true, input_html: { maxlength: 254 }
+ = f.input :title, label: "Title of your talk", required: true, input_html: { maxlength: 254 }
+ = f.input :description, label: "Brief description of your talk (1000 characters maximum)", required: true, input_html: { maxlength: 1000, rows: 8 }
+ = f.input :bio, label: "A one sentence biographical description of your background (100 characters maximum).", required: true, input_html: { maxlength: 100, rows: 1 }
+ = f.input :website, label: "Your website URL, if any", required: false, input_html: { maxlength: 254 }
+ = f.input :phone, label: "Daytime phone number", required: false, input_html: { maxlength: 254 }
.actions
= f.button :submit, value: "Save Proposal", class: "btn btn-primary"
5 spec/models/proposal_spec.rb
View
@@ -24,6 +24,11 @@
proposal.hash_code.should == "0c71da6154"
end
+ it { should ensure_length_of(:speaker_name).is_at_most(254) }
+ it { should ensure_length_of(:title).is_at_most(254) }
+ it { should ensure_length_of(:email).is_at_most(254) }
+ it { should ensure_length_of(:phone).is_at_most(254) }
+ it { should ensure_length_of(:website).is_at_most(254) }
it { should ensure_length_of(:description).is_at_most(1000) }
it { should ensure_length_of(:bio).is_at_most(100) }
end
Please sign in to comment.
Something went wrong with that request. Please try again.