Sha256: 588321f0056150c995c66eb6ae456168cfde734c49a4ed0fa1a3afc88483ecf6
Contents?: true
Size: 658 Bytes
Versions: 36
Compression:
Stored size: 658 Bytes
Contents
require "rails/generators" module Generators module Avo class FilterGenerator < ::Rails::Generators::NamedBase source_root File.expand_path("templates", __dir__) class_option :multiple_select, type: :boolean class_option :select, type: :boolean class_option :text, type: :boolean namespace "avo:filter" def create_resource_file type = "boolean" type = "multiple_select" if options[:multiple_select] type = "select" if options[:select] type = "text" if options[:text] template "filters/#{type}_filter.tt", "app/avo/filters/#{singular_name}.rb" end end end end
Version data entries
36 entries across 36 versions & 1 rubygems