admin/views/locations/_form.haml
- error = @location.errors.include?(:name)
%fieldset.control-group{:class => error ? 'has-error' : ''}
=f.label :name, :class => 'control-label'
.controls
=f.text_field :name, :class => 'input-xlarge input-with-feedback', :autofocus => true
%span.help-inline=error ? f.error_message_on(:name, :class => 'text-error') : pat(:example)
- error = @location.errors.include?(:city_id)
%fieldset.control-group{:class => error ? 'has-error' : ''}
=f.label :city_id, :class => 'control-label'
.controls
=f.text_field :city_id, :class => 'input-xlarge input-with-feedback'
%span.help-inline=error ? f.error_message_on(:city_id, :class => 'text-error') : pat(:example)
.form-actions
=f.submit pat(:save), :class => 'btn btn-primary'
=f.submit pat(:save_and_continue), :class => 'btn btn-info', :name => 'save_and_continue'
=link_to pat(:cancel), url(:locations, :index), :class => 'btn'