Skip to content

Commit

Permalink
Add function to return form value types
Browse files Browse the repository at this point in the history
Thanks @veger
  • Loading branch information
bricesanchez committed Oct 14, 2017
1 parent 9d42e9b commit 8f9b820
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions app/models/refinery/setting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ def per_page
12
end

def form_value_types
FORM_VALUE_TYPES
end

# find_or_set offers a convenient way to
def find_or_set(name, the_value, options={})
# Merge default options with supplied options.
Expand Down
4 changes: 2 additions & 2 deletions app/views/refinery/admin/settings/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<%= render '/refinery/admin/error_messages', :object => @setting, :include_object_name => true %>

<div class='field'>
<div class='field'>
<% if action_name =~ /(new)|(create)/ %>
<%= f.label :name %>
<%= f.text_field :name, :class => "larger widest" %>
Expand All @@ -14,7 +14,7 @@
<% if current_refinery_user.has_role?(:superuser) && @setting.new_record? %>
<div class='field'>
<%= f.label :form_value_type %>
<%= f.select :form_value_type, ::Refinery::Setting::FORM_VALUE_TYPES -%>
<%= f.select :form_value_type, ::Refinery::Setting::form_value_types -%>
</div>
<% end %>
<% unless action_name =~ /(new)|(create)/ or (help = t(@setting.name, :scope => 'refinery.admin.settings.form.help', :default => '')).blank? or @setting.form_value_type == 'check_box' %>
Expand Down

0 comments on commit 8f9b820

Please sign in to comment.