Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Can now add a single cc address at issue creation. Can't figure out a…
…n elegant way to dynamically increase the number of inputs. Right now i'm looking for a num_cc_fields parameter that you can use to render extras if necessary. Those addresses that are put into the form will also get CCed on the originating email, as well as subsequent emails involving that issue...
- Loading branch information
Showing
5 changed files
with
24 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
class CcAddress < ActiveRecord::Base | ||
belongs_to :issue | ||
validates_presence_of :issue_id, :mail | ||
|
||
validates_presence_of :mail | ||
validates_format_of :mail, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
<p id="p-cc-addresses"> | ||
<%= issue.id %> | ||
<div id="div-cc-addresses"> | ||
<%- form.fields_for :cc_addresses do |cc_address_form| %> | ||
<p> | ||
<%= cc_address_form.text_field :mail, :size => 50 %> | ||
<%= cc_address_form.hidden_field :issue_id, :value => @issue.id %> | ||
<input type="button" value="+" /> | ||
</p> | ||
<p id="cc-address-0"> | ||
<%= cc_address_form.text_field :mail, :size => 50, :label => 'CC Address' %> | ||
</p> | ||
<%- end %> | ||
</p> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters