Class: Spud::Blog::ViewsGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/spud/blog/views_generator.rb

Instance Method Summary collapse

Instance Method Details

#installObject



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/generators/spud/blog/views_generator.rb', line 7

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