Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%= mark_required(@user, :email) %>
- # module ApplicationHelper
- # def mark_required(object, attribute)
- # "*" if object.class.validators_on(attribute).map(&:class).include? ActiveModel::Validations::PresenceValidator
- # end
- # end
- 1. <%= form_for(@user) do |f| %>
- 2. <%= render "shared/error_messages", :target => @user %>
- 3. <div class="field">
- 4. <%= f.label :name %><%= mark_required(@user, :name) %><br />
- 5. <%= f.text_field :name %>
- 6. </div>
- 7. <div class="field">
- 8. <%= f.label :email %><%= mark_required(@user, :email) %><br />
- 9. <%= f.text_field :email %>
- 10. </div>
- 11. <div class="actions">
- 12. <%= f.submit %>
- 13. </div>
- 14. <% end %>
Add Comment
Please, Sign In to add comment