Guest User

Untitled

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