title: Using Padrino form helpers and formbuilder - getting started
body: <p>I've jumped into learning Ruby by going straight to Padrino with Haml.</p>
  
  <p>Most of the Padrino documentation assumes a high-level of knowledge of Ruby/Sinatra etc...</p>
  
  <p>I am looking for samples that I can browse to see how things work.  One specific scenario is doing a simple form.  On my main (index) page I want a "sign up" edit box with button.</p>
  
  <pre><code>#app.rb
  ...
  get :index, :map =&gt; "/" do
    @user = "test"
    haml: index
  end
  
  get :signup, :map =&gt; "/signup" do
    render :haml, "%p email:" + params[:email]
  end
  ...
  </code></pre>
  
  <p>In my view:</p>
  
  <pre><code>#index.haml
  ...
  #signup
    -form_for @user, '/signup', :id =&gt; 'signup' do |f|
      = f.text_field_block :email
      = f.submit_block "Sign up!", :class =&gt; 'button'
  ...
  </code></pre>
  
  <p>This does not work. The <code>render</code> in (<code>/signup</code>) never does anything.</p>
  
  <p>Note, I know that I need to define my model etc...; but I'm building to to that in my learning.</p>
  
  <p>Instead of just telling me what I'm doing wrong here, what I'd really like is a fairly complete Padrino sample app that uses forms (the blog sample only covers a small part of Padrino's surface area). </p>
  
  <p>Where can I find tons of great Padrino samples? :-)</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>The answer below was helpful in pointing me at more samples. But I'm still not finding any joy with what's wrong with my code above.</p>
  
  <p>I've changed this slightly in my hacking and I'm still not getting the <code>:email</code> param passed correctly:</p>
  
  <pre><code>#index.haml
  ...
    #signup
       - form_for :User, url(:signup, :create), :method =&gt; 'post' do |f|
         = f.text_field_block :email
         = f.submit_block "Sign up!"
  ...    
  
  #signup.rb
  ...
  post :create do
    @user = User.new(params[:email])
    ...
  end
  </code></pre>
  
  <p><strong>EDIT</strong> Added Model:</p>
  
  <pre><code>#user.rb
  class User
    include DataMapper::Resource
    property :id, Serial
    property :name, String
    property :email, String
    ...
  end
  </code></pre>
  
  <p>When this runs, <code>params[:email]</code> is always <code>nil</code>.  I've compared this to bunches of other samples and I can't see what the heck I'm doing wrong. Help!</p>