class Myg::TabsGenerator

Public Instance Methods

create_templates() click to toggle source
# File lib/generators/myg/tabs_generator.rb, line 18
def create_templates
  template '_tabs.html.erb', "app/views/#{options[:controller]}/"\
                             '_tabs.html.erb'
  options[:method_names]&.each do |name|
    @name = name[:name].underscore
    template 'tab.html.erb', "app/views/#{options[:controller]}/"\
                             "#{@name}.html.erb"
    template '_tab.html.erb', "app/views/#{options[:controller]}/"\
                              "_#{@name}.html.erb"
  end
end