lib/faalis/dashboard/dsl/base.rb in faalis-2.1.1 vs lib/faalis/dashboard/dsl/base.rb in faalis-2.2.0.pre.rc1
- old
+ new
@@ -32,10 +32,13 @@
def attributes(*fields_name, **options, &block)
if options.include? :except
@fields = resolve_model_reflections.reject do |field|
options[:except].include? field.to_sym
end
+ elsif options.include? :append
+
+ @fields += options[:append]
else
# Check for valid field names
fields_name.each do |name|
unless @fields.include? name.to_s
@@ -55,12 +58,12 @@
# and return a page aware list of all the objects.
#
# You can easily change it via the corresponding section dsl.
# For example in case of `index` section:
#
- # in_index do
- # scope do |params|
+ # in_index do |index|
+ # index.scope do |params|
# YourModel.all
# end
#
# # or ...
#
@@ -81,10 +84,10 @@
end
# Define a new action on the `action` place of the current section
# **options**: Is a hash which contains the action button properties.
#
- # `label`: Label to use with the button.
+ # `name`: Label to use with the button.
# `href`: The link href to use in the `a` tag
# `class`: classes of the button.
# `icon_class`: font awesome icon to use in button.
def action_button(**options)
@action_buttons ||= []