title: RoR 3 - overriding the FormBuilder default f.submit into a button
body: <p>I have a form, and for layout (and future use), i would like to know how to change the default f.submit that generates a: </p>
  
  <p></p>
  
  <p>To a  html tag that shouldn't give any errors.</p>
  
  <p>What i have now is an extention on the formbuilder</p>
  
  <p>In my view:</p>
  
  <pre><code>   &lt;%= form_for resource, :as =&gt; resource_name, :url =&gt; session_path(resource_name),  :class =&gt; "form with-margin", :builder =&gt; AppFormBuilder do |f| %&gt;
     ...
     &lt;%= f.submit %&gt;
     &lt;% end %&gt;
  </code></pre>
  
  <p>In my lib/appformbuilder: </p>
  
  <pre><code>class AppFormBuilder &lt; ActionView::Helpers::FormBuilder
    def submit(text, options = {})
      options[:type] = "submit"
      @template.content_tag(:button, text, options)
    end
  end
  </code></pre>
  
  <p>But this gives me an error:</p>
  
  <pre><code>NameError in Devise/sessions#new
  
  Showing d:/Projects/Websites/Ruby On Rails/fact-it/app/views/devise/sessions/new.html.erb where line #11 raised:
  uninitialized constant ActionView::CompiledTemplates::AppFormBuilder
  
  
  8:         
  9:       &lt;p class="message error no-margin alert"&gt;&lt;%= alert %&gt;&lt;/p&gt;
  10:       &lt;p class="notice"&gt;&lt;%= notice %&gt;&lt;/p&gt;
  11:       &lt;%= form_for resource, :as =&gt; resource_name, :url =&gt; session_path(resource_name), :class =&gt; "form with-margin", :builder =&gt; AppFormBuilder do |f| %&gt;
  12:         &lt;p&gt;&lt;%= f.label :email %&gt;&lt;br /&gt;
  13:         &lt;%= f.text_field :email %&gt;&lt;/p&gt;
  14: 
  </code></pre>