RoR - howto convert some HTML-elements with css to Rails
- by NicoJuicy
I have old HTML code with html and css..
<form action="login" method="post">
<div class="field">
<label for="username">Username</label>
<input type="text" class="text" id="username" name="username" value="just click login !"/>
</div>
<span class="fright">
<button class="button" type="submit"><strong>Log In</strong></button>
</span>
</div>
How can i convert this code to decent rails code?
I came up with this, but it ain't right :-( :
<% form_for :user, @user, :url => { :action => "login" } do |f| %>
<% div_for f, :class => "field text" do %>
<%= f.text_field :username %>
<%= f.password_field :password, :class => "field text" %>
<% end %>
<span class="fright">
<%= submit_tag '<strong>Inloggen</strong>', :class => "button",:disable_with => 'verwerken...' %></span>
<% end %>
I'm having problems with the
<strong>Inloggen</strong>
And with the
<% div_for f, :class => "field text" do %>