Browse files

Try to improve formatting.

  • Loading branch information...
1 parent 6a51995 commit 5db50cee31e85ea15f27956cf5aa0493e265ad82 @josevalim josevalim committed Dec 28, 2009
Showing with 12 additions and 12 deletions.
  1. +12 −12 README.rdoc
@@ -1,6 +1,6 @@
== MailForm
-==== Rails 3
+=== Rails 3
This gem was built on top of ActiveModel to showcase how you can pull in validations, naming
and i18n from Rails to your models without the need to implement it all by yourself.
@@ -10,7 +10,7 @@ on how to use MailForm in Rails 2.x, please check the v1.0 branch:
-==== Description
+=== Description
MailForm allows you to send an e-mail straight from a form. For instance,
if you want to make a contact form just the following lines are needed (including the e-mail):
@@ -36,7 +36,7 @@ Then you start a script/console and type:
Check your inbox and the e-mail will be there, with the sent fields (assuming that
you configured your mailer delivery method properly).
-==== MailForm::Resource
+=== MailForm::Resource
When you inherit from MailForm::Resource, it pulls down a set of stuff from ActiveModel,
as ActiveModel::Validation, ActiveModel::Translation and ActiveModel::Naming.
@@ -54,7 +54,7 @@ You could actually do this:
Choose the one which pleases you the most. For more information on the API, please
continue reading below.
-==== Playing together ORMs
+=== Playing together ORMs
MailForm plays nice with ORMs as well. You just need to include MailForm::Delivery
in your model and declare which attributes should be sent:
@@ -82,7 +82,7 @@ If you want it as plugin, just do:
== API Overview
-==== attributes(*attributes)
+=== attributes(*attributes)
Declare your form attributes. All attributes declared here will be appended
to the e-mail, except the ones :captcha is true.
@@ -135,7 +135,7 @@ Examples:
c = => 'José', :email => '')
c.deliver #=> true
-==== subject(string_or_symbol_or_block)
+=== subject(string_or_symbol_or_block)
Declares the subject of the contact email. It can be a string or a proc or a symbol.
@@ -146,7 +146,7 @@ to the class human name.
subject "My Contact Form"
subject { |c| "Contacted by #{}" }
-==== sender(string_or_symbol_or_block)
+=== sender(string_or_symbol_or_block)
Declares contact email sender. It can be a string or a proc or a symbol.
@@ -157,7 +157,7 @@ name as the symbol. As a proc, it receives a mail form instance. By default is:
This requires that your MailForm object have an email attribute.
-==== recipients(string_or_array_or_symbol_or_block)
+=== recipients(string_or_array_or_symbol_or_block)
Who will receive the e-mail. Can be a string or array or a symbol or a proc.
@@ -166,7 +166,7 @@ name as the symbol. As a proc, it receives a mail form instance.
Both the proc and the symbol must return a string or an array. By default is nil.
-==== append(*methods)
+=== append(*methods)
MailForm also makes easy to append request information from client to the sent
mail. You just have to do:
@@ -185,16 +185,16 @@ The remote ip, user agent and session will be sent in the e-mail in a
request information session. You can give to append any method that the
request object responds to.
-==== template(string_or_symbol_or_proc)
+=== template(string_or_symbol_or_proc)
Allow you to set the template that is going to rendered. This allows you to have
several MailForm instances, using different templates.
-==== headers(hash)
+=== headers(hash)
Configure additional headers to your e-mail.
-==== MailForm.template_root
+=== MailForm.template_root
MailForm by default is configured to use the template which comes with the gem.
If you want to use another, you just need to configure MailForm template root

0 comments on commit 5db50ce

Please sign in to comment.