RoR - howto convert some HTML-elements with css to Rails

Posted by NicoJuicy on Stack Overflow See other posts from Stack Overflow or by NicoJuicy
Published on 2010-02-08T10:26:44Z Indexed on 2010/03/19 23:41 UTC
Read the original article Hit count: 271

Filed under:
|
|
|

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  %>

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about css