Class: Talkable::ExampleNewsletterSignupGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
SharedGeneratorMethods
Defined in:
lib/talkable/generators/example_newsletter_signup_generator.rb

Instance Method Summary collapse

Methods included from SharedGeneratorMethods

#erb?, #template_lang

Instance Method Details

#add_invite_controllerObject



11
12
13
14
15
16
17
18
19
20
# File 'lib/talkable/generators/example_newsletter_signup_generator.rb', line 11

def add_invite_controller
  ext = template_lang

  copy_file "app/controllers/example_newsletter_signup_controller.rb", "app/controllers/example_newsletter_signup_controller.rb"
  copy_file "app/views/example_newsletter_signup/register.html.#{ext}", "app/views/example_newsletter_signup/register.html.#{ext}"
  copy_file "app/views/example_newsletter_signup/thank_you.html.#{ext}", "app/views/example_newsletter_signup/thank_you.html.#{ext}"
  route "get '/example_newsletter_signup/thank_you' => 'example_newsletter_signup#thank_you'"
  route "get '/example_newsletter_signup' => 'example_newsletter_signup#register'"
  route "post '/example_newsletter_signup' => 'example_newsletter_signup#submit'"
end