Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AttributeCop
============

Know those little red stars that appear next to required fields in a form? AttributeCop can automatically add them for you. Just install to vendor/plugins.


Example
=======

Model
-----
    class Person < ActiveRecord::Base
      validates_presence_of :name
    end

View
----
    <%= form_for @person do |f| %>
      <%= f.label :name %>
    <% end %>

HTML (from the view)
--------------------
    ...
    <label for="person_name" class="required">Name</label>
    ...

CSS
---
    label.required:after {
      color: red;
      content: " *";
    }


Copyright (c) 2011 Zach Church, released under the MIT license

About

Add little stars to the required fields in your form

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages