28 lines
952 B
Plaintext
28 lines
952 B
Plaintext
|
- model = eval(object.class.model_name)
|
||
|
- model_string = object.class.model_name.downcase
|
||
|
- label.nil? ? model_label = model.human_attribute_name(attr) : model_label = t(label.to_sym)
|
||
|
- val = value || object.instance_eval(attr) || ""
|
||
|
- if object.errors[attr.to_sym].empty?
|
||
|
- to_class ||= ""
|
||
|
- rows ||= 5
|
||
|
.control-group
|
||
|
%label{:class=>"control-label",:for=>"#{attr}"}
|
||
|
= model_label
|
||
|
.controls
|
||
|
%textarea{:rows=>"#{rows}",:class=>"#{to_class}",:id=>"#{model_string}_#{attr}",:name=>"#{model_string}[#{attr}]"}
|
||
|
= val
|
||
|
%p{:class=>"help-block"}
|
||
|
= t(:example,:scope=>:common)
|
||
|
= example
|
||
|
- else
|
||
|
.control-group.error
|
||
|
%label{:class=>"control-label",:for=>"#{attr}"}
|
||
|
= model_label
|
||
|
.controls
|
||
|
%input{:id=>"#{model_string}_#{attr}",:name=>"#{model_string}[#{attr}]",:value=>"#{val}"}
|
||
|
%span{:class=>"help-inline"}
|
||
|
= object.errors[attr.to_sym].to_s
|
||
|
%p{:class=>"help-block"}
|
||
|
= t(:example,:scope=>:common)
|
||
|
= example
|