How to customize Ruby tags on Rails?

Asked

Viewed 145 times

1

I have a form:

<% form_tag :action => 'validacao' do %>
      <p> Login: <%= text_field :acesso, :email %></p>
      <p> Senha: <%= password_field :acesso, :password %></p>
      <p><%= submit_tag 'Entrar' %></p>
<% end %>

How to put properties like class in the text_field, in the password_field and the button submit_tag?

1 answer

0


Thank you very much, but no longer need, I continued researching and found the answers right here:
https://stackoverflow.com/questions/14658054/rails-and-haml-how-to-add-id-and-class-selectors-to-link-to-helper
Just use it as follows:

<% form_tag :action => 'validacao' do %>
<p class="form-inline"> Login: <%= text_field :acesso, :email, :class => "form-control" %></p>
  <p class="form-inline"> Senha: <%= password_field :acesso, :password, :class => "form-control" %></p>
  <p><%= submit_tag 'Entrar', :class => "btn btn-default" %></p>
<% end %>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.