Create a model Contact:

*rails g model contact name:string subject:string message:text*


Create a controller contacts
*rails g controller contacts *

add routes
*routes :contacts*

Create a view page

new.html.erb
--------------------

*<%= form_for @contact %>*

*   -----your code ----*
*<% end %>*




*controller :------------------def new*

*  @contact = Contact.new*


*end*

*def create *

*  @contact.save *

* #write here action mailer method*
*end*


for mailing see below link:
-------------------------------------

http://guides.rubyonrails.org/action_mailer_basics.html




On Fri, Jul 18, 2014 at 12:06 PM, bradford li <[email protected]> wrote:

> I am new to ruby on rails and I am trying to create a small website as
> practice. Right now I am in the process of creating a Contact page.
> Basically this page will be a form to allow visitors send an email to only
> me. This form will have name, message, subject and other information a
> typical contact me page will have. I am new and I'm not sure where to
> start. Could someone guide me through this process? I am open to gems but I
> am also curious on how to perform this action without gems so I can learn
> more about the rails framework. Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/d5e1ad03-d8bf-45fe-8ba4-772bbb55236d%40googlegroups.com
> <https://groups.google.com/d/msgid/rubyonrails-talk/d5e1ad03-d8bf-45fe-8ba4-772bbb55236d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
----------------------------------------------------------------------------------------------------
Thank You.

Best Wishes,

BalaRaju Vankala,
8886565300.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAGQ0aicx0D%3Dqye3CPr3o46E-utVrQqgEnfufNgvkj154DQwPrQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to