Sha256: f17eb4c8ec1e56def7618bb656b8a459c5fd6a6d5fe7d2c623a91d4f5d809f8d

Contents?: true

Size: 492 Bytes

Versions: 90

Compression:

Stored size: 492 Bytes

Contents

# frozen_string_literal: true

module Rails
  # Add Navigation bar to Rails application
  class NavigationGenerator < Rails::Generators::NamedBase
    def add_link
      append_to_file 'app/views/shared/_navbar.html.erb',
                     after: '<!-- SZ Link Placeholder -->' do
        <<-HTML

        <%= link_to "#{plural_name.capitalize}", #{plural_name}_path, class: "block md:inline-block p-3 border-b-2 border-gray-100 md:border-none" %>
        HTML
      end
    end
  end
end

Version data entries

90 entries across 90 versions & 1 rubygems

Version Path
rails_app_generator-0.0.15 templates/addons/generators/lib/generators/rails/navigation/navigation_generator.rb
rails_app_generator-0.0.14 templates/addons/generators/lib/generators/rails/navigation/navigation_generator.rb
rails_app_generator-0.0.13 templates/addons/generators/lib/generators/rails/navigation/navigation_generator.rb
rails_app_generator-0.0.12 templates/addons/generators/lib/generators/rails/navigation/navigation_generator.rb
rails_app_generator-0.0.11 templates/addons/generators/lib/generators/rails/navigation/navigation_generator.rb
rails_app_generator-0.0.10 templates/addons/generators/lib/generators/rails/navigation/navigation_generator.rb
rails_app_generator-0.0.9 templates/addons/generators/lib/generators/rails/navigation/navigation_generator.rb
rails_app_generator-0.0.8 templates/addons/generators/lib/generators/rails/navigation/navigation_generator.rb
rails_app_generator-0.0.7 templates/addons/generators/lib/generators/rails/navigation/navigation_generator.rb
rails_app_generator-0.0.6 templates/addons/generators/lib/generators/rails/navigation/navigation_generator.rb