diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/models/gateway_parameter.rb | 4 | ||||
-rw-r--r-- | app/views/gateway_parameters/_form_core.html.haml | 2 | ||||
-rw-r--r-- | app/views/gateway_parameters/_index_core.html.haml | 6 |
3 files changed, 5 insertions, 7 deletions
diff --git a/app/models/gateway_parameter.rb b/app/models/gateway_parameter.rb index 3dd2a95..a66af75 100644 --- a/app/models/gateway_parameter.rb +++ b/app/models/gateway_parameter.rb @@ -1,4 +1,6 @@ class GatewayParameter < ActiveRecord::Base + CLASS_TYPES = ['String', 'Integer', 'Boolean'] + attr_accessible :gateway_id, :name, :value, :class_type, :description belongs_to :gateway, :touch => true @@ -9,7 +11,7 @@ class GatewayParameter < ActiveRecord::Base validates :class_type, :presence => true, - :inclusion => { :in => ['String', 'Integer', 'Boolean'] } + :inclusion => { :in => CLASS_TYPES } def to_s name diff --git a/app/views/gateway_parameters/_form_core.html.haml b/app/views/gateway_parameters/_form_core.html.haml index ee30238..206645d 100644 --- a/app/views/gateway_parameters/_form_core.html.haml +++ b/app/views/gateway_parameters/_form_core.html.haml @@ -1,5 +1,5 @@ .inputs = f.input :name, :label => t('gateway_parameters.form.name.label'), :hint => conditional_hint('gateway_parameters.form.name.hint'), :autofocus => true = f.input :value, :label => t('gateway_parameters.form.value.label'), :hint => conditional_hint('gateway_parameters.form.value.hint') - = f.input :class_type, :label => t('gateway_parameters.form.class_type.label'), :hint => conditional_hint('gateway_parameters.form.class_type.hint') + = f.input :class_type, :collection => GatewayParameter::CLASS_TYPES, :label => t('gateway_parameters.form.class_type.label'), :hint => conditional_hint('gateway_parameters.form.class_type.hint'), :include_blank => false = f.input :description, :label => t('gateway_parameters.form.description.label'), :hint => conditional_hint('gateway_parameters.form.description.hint') diff --git a/app/views/gateway_parameters/_index_core.html.haml b/app/views/gateway_parameters/_index_core.html.haml index 3d4b6df..c22093d 100644 --- a/app/views/gateway_parameters/_index_core.html.haml +++ b/app/views/gateway_parameters/_index_core.html.haml @@ -1,17 +1,13 @@ %table %tr - %th= t('gateway_parameters.index.gateway_id') %th= t('gateway_parameters.index.name') %th= t('gateway_parameters.index.value') - %th= t('gateway_parameters.index.class_type') %th= t('gateway_parameters.index.description') - reset_cycle - for gateway_parameter in gateway_parameters %tr{:class => cycle('odd', 'even')} - %td= gateway_parameter.gateway %td= gateway_parameter.name %td= gateway_parameter.value - %td= gateway_parameter.class_type %td= gateway_parameter.description - =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => gateway_parameter.gateway, :child => gateway_parameter}
\ No newline at end of file + =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => gateway_parameter.gateway, :child => gateway_parameter} |