Ruby on Rails 3 Form radio button, text_field, error_messages, date_select

09.49 Muhamad Akbar Bin Widayat 0 Comments

<% form_for @user do |f| %>
<% if @user.errors.any? %>
   <div class="error_messages">
<h2>Form is invalid</h2>
<ul>
<% for message in @user.errors.full_messages %>
<li><%= message %></li>
<% end %>
</ul>
</div>
<% end %>
<p>
<%= f.label :email %><br />
<%= f.text_field :email %>
</p>
<p>
<%= f.label :password %><br />
<%= f.password_field :password %>
</p>
<p>
<%= f.label :password_confirmation %><br />
<%= f.password_field :password_confirmation %>
</p>
<p>
<%= f.label :name %><br />
<%= f.text_field :name %>
</p>
<p>
<%= f.label :address %><br />
<%= f.text_field :address %>
</p>
<p>
<%= f.label :phone_number %><br />
<%= f.text_field :phone_number %>
</p>
<p>
<%= f.label :birthday %><br />
<%= f.date_select :birthday, :start_year => 1950 %>
</p>
<p>
<%= f.label :gender %><br />
<%= f.radio_button :gender, true %>Male
    <%= f.radio_button :gender, false %>Female
</p>
<p>
<%= f.label :facebook %><br />
<%= f.text_field :facebook %>
</p>
<p>
<%= f.label :blog %><br />
<%= f.text_field :blog %>
</p>
<p>
<%= recaptcha_tags %>
</p>
<p>
<%= f.submit "Sign Up"%>
</p>
<% end %>



0 komentar:

terimakasih komentarnya