nicopaez/camilo

View on GitHub
admin/views/ratings/_form.haml

Summary

Maintainability
Test Coverage
- error = @rating.errors.key?(:value) && @rating.errors[:value].count > 0
%fieldset.control-group{:class => error ? 'has-error' : ''}
  =f.label :value, :class => 'control-label'
  .controls
    =f.text_field :value, :class => 'input-xlarge input-with-feedback', :autofocus => true
    %span.help-inline=error ? f.error_message_on(:value, :class => 'text-error') : pat(:example)
- error = @rating.errors.key?(:comment) && @rating.errors[:comment].count > 0
%fieldset.control-group{:class => error ? 'has-error' : ''}
  =f.label :comment, :class => 'control-label'
  .controls
    =f.text_field :comment, :class => 'input-xlarge input-with-feedback'
    %span.help-inline=error ? f.error_message_on(:comment, :class => 'text-error') : pat(:example)
- error = @rating.errors.key?(:event_id) && @rating.errors[:event_id].count > 0
%fieldset.control-group{:class => error ? 'has-error' : ''}
  =f.label :event_id, :class => 'control-label'
  .controls
    =f.text_field :event_id, :class => 'input-xlarge input-with-feedback'
    %span.help-inline=error ? f.error_message_on(:event_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(:ratings, :index), :class => 'btn'