I\'m new to all three, and I\'m trying to write a simple contact form for a website. The code I have come up with is below, but I know there are some fundamental problems with
I figured it out for any of you wondering:
haml:
%form{ :action => "", :method => "post"}
%fieldset
%ol
%li
%label{:for => "name"} Name:
%input{:type => "text", :name => "name", :class => "text"}
%li
%label{:for => "mail"} email:
%input{:type => "text", :name => "mail", :class => "text"}
%li
%label{:for => "body"} Message:
%textarea{:name => "body"}
%input{:type => "submit", :value => "Send", :class => "button"}
And the app.rb:
post '/contact' do
name = params[:name]
mail = params[:mail]
body = params[:body]
Pony.mail(:to => '*emailaddress*', :from => "#{mail}", :subject => "art inquiry from #{name}", :body => "#{body}")
haml :contact
end