Sha256: 26fc8df00870baa33672678e21c00c32762a62d6bb9d0cb86c5f09ebf6f92bec

Contents?: true

Size: 651 Bytes

Versions: 8

Compression:

Stored size: 651 Bytes

Contents

require 'rails/generators/migration'

class Spud::Blog::ViewsGenerator < ::Rails::Generators::Base

  source_root File.join(Spud::Blog::Engine.root, 'app/views')

  def install
    if Spud::Blog.config.blog_enabled
      copy_file 'posts/_comment_form.html.erb', 'app/views/blog/_comment_form.html.erb'
      copy_file 'posts/index.html.erb', 'app/views/blog/index.html.erb'
      copy_file 'posts/show.html.erb', 'app/views/blog/show.html.erb'
    end
    if Spud::Blog.config.news_enabled
      copy_file 'posts/index.html.erb', 'app/views/news/index.html.erb'
      copy_file 'posts/show.html.erb', 'app/views/news/show.html.erb'
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
tb_blog-1.4.4 lib/generators/spud/blog/views_generator.rb
tb_blog-1.4.3 lib/generators/spud/blog/views_generator.rb
tb_blog-1.4.2 lib/generators/spud/blog/views_generator.rb
tb_blog-1.3.5 lib/generators/spud/blog/views_generator.rb
tb_blog-1.4.1 lib/generators/spud/blog/views_generator.rb
tb_blog-1.4.0 lib/generators/spud/blog/views_generator.rb
tb_blog-1.3.4 lib/generators/spud/blog/views_generator.rb
tb_blog-1.4.beta1 lib/generators/spud/blog/views_generator.rb