Skip to content
Browse files

add foreign index to transaction model

  • Loading branch information...
1 parent f8d3135 commit b34ca7b6771fa1660e76e2d99a3b0920155302e5 David Lee committed Sep 24, 2012
View
4 app/views/layouts/_footer.html.erb
@@ -15,12 +15,12 @@
<div class="span3">
<h3>Contact Us!</h3>
Have a question or comment? We can help you!<br>
- <br>by phone: 1-(555)-555-5555
+ <br>by phone: (415)-453-5555
<br>by mail: titheswsf@gmail.com
</div>
<div class="span3">
<h3>Newsletter</h3>
- <p>Subscribe to our newsletter and get the latest news!</p>
+ <p>Subscribe to our newsletter and get the latest updates!</p>
<form action="#" id="subscribe-form" method="post">
<input type="text" name="email" id="email" placeholder="Your Email Address">
<button type="submit" class="btn btn-primary">Sign Up</button>
View
2 app/views/organizations/index.html.erb
@@ -1,5 +1,5 @@
<h1>All Organizations</h1>
-<h3><div class="center"><%= link_to 'Add New Organization', new_organization_path, class: "btn btn-primary btn-large" %></div></h3>
+<h3><div class="center"><%= link_to 'Add New Organization', new_organization_path, class: "btn btn-primary btn-large" %> <%= link_to 'Contribute to an organization', new_transaction_path, class: "btn btn-primary btn-large" %></div></h3>
<table>
<tr>
<th>Organization Name</th>
View
8 app/views/transactions/new.html.erb
@@ -1,4 +1,4 @@
-<h1>Signing up for "<%= "****" %>"</h1>
+<h1>Make a contribution</h1>
<%= form_for @transaction do |f| %>
<% if @transaction.errors.any? %>
@@ -18,7 +18,7 @@
<div class="field">
<%= f.label :amount, "Monthly Contribution. You may cancel at anytime" %>
- <%= f.text_field :amount %>
+ <%= f.text_field :amount, :placeholder => "$" %>
</div>
<% if @transaction.stripe_card_token.present? %>
Credit card information has already been provided.
@@ -41,8 +41,8 @@
<noscript>JavaScript is not enabled and is required for this form. Please enable it in your web browser settings.</noscript>
</div>
<div class="actions">
- <%= f.submit "Contribute!" %>
+ <%= f.submit "Contribute!", :class => "btn btn-primary" %>
</div>
<% end %>
-<%=@transaction %>
+<%=debug @transaction %>
View
6 db/migrate/20120924203116_add_index_to_transaction.rb
@@ -0,0 +1,6 @@
+class AddIndexToTransaction < ActiveRecord::Migration
+ def change
+ add_index :transactions, :user_id
+ add_index :transactions, :organization_id
+ end
+end
View
5 db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20120923032719) do
+ActiveRecord::Schema.define(:version => 20120924203116) do
create_table "organizations", :force => true do |t|
t.string "name"
@@ -32,6 +32,9 @@
t.datetime "updated_at", :null => false
end
+ add_index "transactions", ["organization_id"], :name => "index_transactions_on_organization_id"
+ add_index "transactions", ["user_id"], :name => "index_transactions_on_user_id"
+
create_table "users", :force => true do |t|
t.string "first_name"
t.string "last_name"

0 comments on commit b34ca7b

Please sign in to comment.
Something went wrong with that request. Please try again.