Sha256: ad6fb7b8a89ddc74342369599ff203671cc9d19375d45b706ea72c9a1ec78596
Contents?: true
Size: 621 Bytes
Versions: 10
Compression:
Stored size: 621 Bytes
Contents
# frozen_string_literal: true require 'rails/generators' module Rails module Generators class DatatableGenerator < ::Rails::Generators::Base desc 'Creates a *_datatable model in the app/datatables directory.' source_root File.expand_path('templates', __dir__) argument :name, type: :string def generate_datatable template 'datatable.rb', File.join('app', 'datatables', "#{datatable_path}.rb") end def datatable_name datatable_path.classify end private def datatable_path "#{name.underscore}_datatable" end end end end
Version data entries
10 entries across 10 versions & 1 rubygems