Skip to content

Commit 79c4d0a

Browse files
committed
Added save template
1 parent e9d3d93 commit 79c4d0a

File tree

5 files changed

+27
-1
lines changed

5 files changed

+27
-1
lines changed

app/controllers/jobs_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def save
4545
respond_to do |format|
4646
#format.html { render :partial => 'save.txt' }#save.html.erb
4747
format.html {render :partial => 'save' }
48-
#format.xml { render :xml => @job }
48+
format.xml { render :xml => @job }
4949
end
5050
end
5151

app/models/my_mailer.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class MyMailer < ActionMailer::Base
2+
3+
4+
end

app/views/jobs/_save.html.erb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<? header("Content-Type: text/plain"); ?>
2+
<pre><% if signed_in? %><%user = user_from_remember_token%><%@job = getJobs(user)%>
3+
Jobid, Rep, Name, Buyer, Booked, Date, Invoice, Shipped, Margin, Commissions, Paid
4+
<% @jobs.each do |job| %>"<%=h job.jobID %>", "<%=h job.rep %>", "<%=h job.name %>", "<%=h job.buyer %>", "<%=h job.booked %>", "<%=h job.date %>", "<%=h job.invoice %>", "<%=h job.shipped %>", "<%=h job.margin %>", "<%=h job.commissions %>", "<%=h job.paid %>"
5+
<% end %><% end %>
6+
</pre>

app/views/jobs/_save.txt.erb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<% if signed_in? %>
2+
<%user = user_from_remember_token%>
3+
<%@job = getJobs(user)%>
4+
Jobid, Rep, Name, Buyer, Booked, Date, Invoice, Shipped, Margin, Commissions, Paid
5+
<% @jobs.each do |job| %>
6+
<%=h job.jobID %>, <%=h job.rep %>, <%=h job.name %>, <%=h job.buyer %>, <%=h job.booked %>, <%=h job.date %>, <%=h job.invoice %>, <%=h job.shipped %>, <%=h job.margin %>, <%=h job.commissions %>, <%=h job.paid %>
7+
<% end %>
8+
<% end %>

test/unit/my_mailer_test.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
require 'test_helper'
2+
3+
class MyMailerTest < ActionMailer::TestCase
4+
# replace this with your real tests
5+
test "the truth" do
6+
assert true
7+
end
8+
end

0 commit comments

Comments
 (0)