Class: RailsAppGenerator::AddOns::Pretender

Inherits:
RailsAppGenerator::Addon show all
Defined in:
lib/rails_app_generator/addons/pretender.rb

Overview

Add Pretender to rails application

Instance Attribute Summary

Attributes inherited from RailsAppGenerator::Addon

#context, #dependencies, #gem_entries

Instance Method Summary collapse

Methods inherited from RailsAppGenerator::Addon

addon_name, dependencies, depends_on, gem, gem_entries, #initialize, required_gem, reset_gem_entries

Constructor Details

This class inherits a constructor from RailsAppGenerator::Addon

Instance Method Details

#applyObject



10
11
12
13
14
15
# File 'lib/rails_app_generator/addons/pretender.rb', line 10

def apply
  copy_file('app/controllers/pretender_controller.rb', 'app/controllers/pretender_controller.rb')

  route("post 'pretender/:user_id/impersonate' , to: 'pretender#impersonate'        , :as => :impersonate_user")
  route("post 'pretender/stop_impersonating'   , to: 'pretender#stop_impersonating' , :as => :stop_impersonating_user")
end