Browse files

Merge remote-tracking branch 'origin/master'

Conflicts:
	Gemfile
	Gemfile.lock
	config/environments/development.rb
  • Loading branch information...
2 parents 1310d36 + 7062fed commit 48c141c254be4502a92f40b0d8f1b6c336de284f @treeder treeder committed Nov 8, 2011
View
2 README.markdown
@@ -18,5 +18,5 @@ gmail:
### Database
-Create a config/database.yml file with your database credentials, typical Rails style.
+Create a config/database.yml file with your database credentials, typical Rails style. Database must be accessible from external hosts.
View
3 app/mailers/mailer.rb
@@ -4,8 +4,7 @@ class Mailer < ActionMailer::Base
def send_post(post, to)
@post = post
mail(:to=>to,
- :subject=>"Post: #{@post.title}")
-
+ :subject=>"Post: #{@post.title}",:body=>"Hey i'm from mailer'")
end
end
View
4 app/views/posts/_form.html.erb
@@ -15,8 +15,8 @@
<%= f.text_field :title %>
</div>
<div class="field">
- <%= f.label :body %><br />
- <%= f.text_area :body %>
+ <%= f.label :content %><br />
+ <%= f.text_area :content %>
</div>
<div class="actions">
<%= f.submit %>
View
7 app/views/posts/index.html.erb
@@ -12,16 +12,15 @@
<% @posts.each do |post| %>
<tr>
<td><%= post.title %></td>
- <td><%= post.body %></td>
+ <td><%= post.content %></td>
<td><%= link_to 'Show', post %></td>
<td><%= link_to 'Edit', edit_post_path(post) %></td>
- <td><%= link_to 'Send', email_post_path(post), :method=>:post %></td>
- <td><%= link_to 'Send Async', email_post_path(post, :async=>true), :method=>:post %></td>
+ <td><%= link_to 'Send', email_post_path(post)%></td>
+ <td><%= link_to 'Send Async', email_post_path(post, :async=>true)%></td>
<td><%= link_to 'Destroy', post, :confirm => 'Are you sure?', :method => :delete %></td>
</tr>
<% end %>
</table>
-
<br />
<%= link_to 'New Post', new_post_path %>
View
2 app/views/posts/show.html.erb
@@ -8,7 +8,7 @@
<p>
<b>Body:</b>
- <%= @post.body %>
+ <%= @post.content %>
</p>
View
10 app/workers/mail_worker.rb
@@ -4,15 +4,9 @@ class MailWorker < SimpleWorker::Base
attr_accessor :post_id, :to
def run
-
log 'running...'
-
@post = Post.find(post_id)
-
- log 'post=' + @post.inspect
-
- #Mailer.send_post(@post, to)
-
+ log Mailer.send_post(@post, "to@example.com").deliver!
end
-end
+end
View
7 config/application.rb
@@ -28,7 +28,12 @@ class Application < Rails::Application
require 'open-uri'
- @private_config = YAML.load_file('config/private.yml')
+ begin
+ @private_config = YAML.load_file('config/private.yml')
+ rescue
+ raise "You must create private.yml, see README."
+ end
+
p @private_config
if @private_config['yml_url']
@private_config.merge!(YAML.load(open(@private_config['yml_url'])))
View
8 config/database.yml.sample
@@ -0,0 +1,8 @@
+development:
+ adapter: mysql2
+ encoding: utf8
+ reconnect: false
+ username: db username here
+ password: db password here
+ host: db host here
+ database: db name here
View
7 config/private.yml.sample
@@ -0,0 +1,7 @@
+sw:
+ access_key: your sw access key here
+ secret_key: your sw secret key here
+
+gmail:
+ username: your.gmail.address.here@gmail.com
+ password: your gmail password here
View
7 db/schema.rb
@@ -11,13 +11,6 @@
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20110504013623) do
-pos
- create_table "db_models", :force => true do |t|
- t.timestamp "created_at", :null => false
- t.timestamp "updated_at", :null => false
- t.string "name", :null => false
- t.integer "age", :null => false
- end
create_table "posts", :force => true do |t|
t.string "name"

0 comments on commit 48c141c

Please sign in to comment.