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!
On 18 July 2014 07:36, 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!
Start by working right through a good tutorial such as
railstutorial.org (which is free to use online). That will show you
the basics of Rails.
Colin
You should create virtual model in case of contact page as you are not
going to store contact information in database.
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:
On Fri, Jul 18, 2014 at 12:06 PM, bradford li [email protected]
wrote:
You received this message because you are subscribed to the Google G.
“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
.
For more options, visit https://groups.google.com/d/optout.
–