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:
To a html tag that shouldn't give any errors.
What i have now is an extention on the formbuilder
In my view:
<%= form_for resource, :as => resource_name, :url => session_path(resource_name), :class => "form with-margin", :builder => AppFormBuilder do |f| %>
...
<%= f.submit %>
<% end %>
In my lib/appformbuilder:
class AppFormBuilder < ActionView::Helpers::FormBuilder
def submit(text, options = {})
options[:type] = "submit"
@template.content_tag(:button, text, options)
end
end
But this gives me an error:
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: <p class="message error no-margin alert"><%= alert %></p>
10: <p class="notice"><%= notice %></p>
11: <%= form_for resource, :as => resource_name, :url => session_path(resource_name), :class => "form with-margin", :builder => AppFormBuilder do |f| %>
12: <p><%= f.label :email %><br />
13: <%= f.text_field :email %></p>
14: