Class: Fullstack::Contacts::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/generators/fullstack/contacts/install_generator.rb', line 10

def banner
  puts "\n# =========================================================\n# = Take the following steps to complete the installation =\n# ========================================================= \n\nEdit 'app/models/contact.rb' to customize 'Contact' model and then run:\n  rails g migration:from contact && rake db:migrate\n\nYou may also wish to customize front-end views editing:\n  - app/views/contacts_mailer/confirmation.html.erb \n  - app/views/contacts_mailer/notify.html.erb\n  - app/views/fullstack/contacts/_form.html.erb\n  - app/views/fullstack/contacts/_success.html.erb\n\nEnable contacts back-end in config/initializers/fullstack.rb:\n\n  admin.group :contacts do |g|\n    g.icon= \"user\"\n    g.resource :contacts\n  end\n\nInstall a widget in your admin/dashboard:\n  \n  <%= contacts_dashboard_widget %>\n\nAdd actions to your controller:\n\n  include Fullstack::Contacts::Actions\n\n  page :contacts, \"/contacts\", :parent => :home do\n    @contact = Contact.new\n  end\n     \n  action :contact, \"/contact\", :via => :post do    \n    create_contact!(:success => polymorphic_path([:site, :contacts], :success => true))\n  end\n\nRender a contact_form inside your views:\n\n  <% if params[:success] %>\n    <%= contact_success %>\n  <% else %>\n    <%= contact_form %>\n  <% end %>\n\n  eos\n  \nend\n"

#install_templatesObject



6
7
8
# File 'lib/generators/fullstack/contacts/install_generator.rb', line 6

def install_templates
  directory "app", Rails.root.join("app")
end