Class: Appointments::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/appointments/install/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#add_controllerObject



17
18
19
# File 'lib/generators/appointments/install/install_generator.rb', line 17

def add_controller
  template "appointments_controller.rb", "app/controllers/appointments_controller.rb"
end

#add_javascriptsObject



29
30
31
32
33
# File 'lib/generators/appointments/install/install_generator.rb', line 29

def add_javascripts
  template "jquery.ui.datepicker.min.js", "public/javascripts/jquery.ui.datepicker.min.js"
  template "jquery.ui.widget.min.js", "public/javascripts/jquery.ui.widget.min.js"
  template "appointment.js", "public/javascripts/appointment.js"
end

#add_modelObject



13
14
15
# File 'lib/generators/appointments/install/install_generator.rb', line 13

def add_model
  template "appointment.rb", "app/models/appointment.rb"
end

#add_routesObject



8
9
10
11
# File 'lib/generators/appointments/install/install_generator.rb', line 8

def add_routes
  resources = "resources :appointments"
  route resources
end

#add_stub_viewObject



25
26
27
# File 'lib/generators/appointments/install/install_generator.rb', line 25

def add_stub_view
  template "index.html.erb", "app/views/appointments/index.html.erb"
end

#add_stylesheetsObject



35
36
37
# File 'lib/generators/appointments/install/install_generator.rb', line 35

def add_stylesheets
  template "jquery-ui-1.8.17.custom.css", "public/jquery-ui-1.8.17.custom.css"
end

#add_viewObject



21
22
23
# File 'lib/generators/appointments/install/install_generator.rb', line 21

def add_view
  template "new.html.erb", "app/views/appointments/new.html.erb"
end