leads_to_highrise 0.1.9 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +8 -8
  2. data/README.rdoc +3 -0
  3. data/app/assets/javascripts/{leads_to_highrise/leads.js → leads.js} +0 -0
  4. data/app/assets/stylesheets/{leads_to_highrise/leads.css → leads.css} +0 -0
  5. data/app/controllers/leads_controller.rb +88 -0
  6. data/app/helpers/leads_helper.rb +2 -0
  7. data/app/models/lead.rb +2 -0
  8. data/app/views/{leads_to_highrise/leads → leads}/_form.html.erb +0 -0
  9. data/app/views/{leads_to_highrise/leads → leads}/edit.html.erb +0 -0
  10. data/{lib/generators/leads_to_highrise/templates/_lead.html.erb → app/views/leads/index.html.erb} +38 -34
  11. data/app/views/{leads_to_highrise/leads → leads}/new.html.erb +0 -0
  12. data/app/views/{leads_to_highrise/leads → leads}/show.html.erb +0 -0
  13. data/config/routes.rb +3 -12
  14. data/{test/dummy/db/migrate/20140416000345_create_leads_to_highrise_leads.rb → db/migrate/20140417073703_create_leads.rb} +2 -2
  15. data/db/migrate/{20140416021234_add_highrise_site_and_highrise_user_to_user.rb → 20140417074432_add_highrise_site_and_highrise_user_to_user.rb} +0 -0
  16. data/lib/generators/leads_to_highrise/install_generator.rb +3 -18
  17. data/lib/generators/leads_to_highrise/templates/{20140416000345_create_leads_to_highrise_leads.rb → 20140417073703_create_leads.rb} +2 -2
  18. data/lib/generators/leads_to_highrise/templates/{20140416021234_add_highrise_site_and_highrise_user_to_user.rb → 20140417074432_add_highrise_site_and_highrise_user_to_user.rb} +0 -0
  19. data/lib/leads_to_highrise/engine.rb +0 -3
  20. data/lib/leads_to_highrise/version.rb +1 -1
  21. data/test/controllers/leads_controller_test.rb +49 -0
  22. data/test/dummy/app/views/layouts/application.html.erb +2 -1
  23. data/test/dummy/config/initializers/devise.rb +2 -2
  24. data/test/dummy/config/routes.rb +55 -2
  25. data/test/dummy/config/secrets.yml +2 -2
  26. data/test/dummy/db/development.sqlite3 +0 -0
  27. data/test/dummy/db/migrate/{20140416014910_devise_create_users.rb → 20140417074003_devise_create_users.rb} +0 -0
  28. data/test/dummy/db/schema.rb +2 -2
  29. data/test/dummy/lib/generators/install/USAGE +8 -0
  30. data/test/dummy/lib/generators/install/install_generator.rb +3 -0
  31. data/test/dummy/log/development.log +282 -3990
  32. data/test/dummy/test/lib/generators/install_generator_test.rb +14 -0
  33. data/test/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  34. data/test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  35. data/test/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  36. data/test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  37. data/test/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  38. data/test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  39. data/test/fixtures/{leads_to_highrise/leads.yml → leads.yml} +0 -0
  40. data/test/helpers/leads_helper_test.rb +4 -0
  41. data/test/lib/generators/install_generator_test.rb +14 -0
  42. data/test/models/lead_test.rb +7 -0
  43. metadata +38 -89
  44. data/app/assets/javascripts/leads_to_highrise/application.js +0 -13
  45. data/app/assets/stylesheets/leads_to_highrise/application.css +0 -15
  46. data/app/controllers/leads_to_highrise/application_controller.rb +0 -4
  47. data/app/controllers/leads_to_highrise/leads_controller.rb +0 -92
  48. data/app/helpers/leads_to_highrise/application_helper.rb +0 -4
  49. data/app/helpers/leads_to_highrise/leads_helper.rb +0 -4
  50. data/app/models/leads_to_highrise/lead.rb +0 -5
  51. data/app/views/layouts/leads_to_highrise/example_application.html.erb +0 -14
  52. data/app/views/leads_to_highrise/leads/_lead.html.erb +0 -34
  53. data/app/views/leads_to_highrise/leads/index.html.erb +0 -34
  54. data/db/migrate/20140416000345_create_leads_to_highrise_leads.rb +0 -15
  55. data/lib/generators/leads_to_highrise/templates/_form.html.erb +0 -45
  56. data/lib/generators/leads_to_highrise/templates/edit.html.erb +0 -6
  57. data/lib/generators/leads_to_highrise/templates/index.html.erb +0 -34
  58. data/lib/generators/leads_to_highrise/templates/new.html.erb +0 -5
  59. data/lib/generators/leads_to_highrise/templates/show.html.erb +0 -39
  60. data/test/controllers/leads_to_highrise/leads_controller_test.rb +0 -51
  61. data/test/dummy/app/views/leads_to_highrise/lead/_form.html.erb +0 -45
  62. data/test/dummy/app/views/leads_to_highrise/lead/_lead.html.erb +0 -34
  63. data/test/dummy/app/views/leads_to_highrise/lead/edit.html.erb +0 -6
  64. data/test/dummy/app/views/leads_to_highrise/lead/index.html.erb +0 -34
  65. data/test/dummy/app/views/leads_to_highrise/lead/new.html.erb +0 -5
  66. data/test/dummy/app/views/leads_to_highrise/lead/show.html.erb +0 -39
  67. data/test/dummy/db/migrate/20140416021234_add_highrise_site_and_highrise_user_to_user.rb +0 -6
  68. data/test/dummy/db/test.sqlite3 +0 -0
  69. data/test/dummy/log/test.log +0 -75
  70. data/test/dummy/tmp/cache/assets/development/sprockets/12ec86eede9697fe92fb83e90b318b88 +0 -0
  71. data/test/dummy/tmp/cache/assets/development/sprockets/33872968d30189cee4d8e79aab64c3d5 +0 -0
  72. data/test/dummy/tmp/cache/assets/development/sprockets/9200ac6353eb1662fce665485f7458e6 +0 -0
  73. data/test/dummy/tmp/cache/assets/development/sprockets/92dd5e2f944ef5e5fa71ed89d9312af1 +0 -0
  74. data/test/dummy/tmp/cache/assets/development/sprockets/97b9412f869910d55fc738ce7dbd88b8 +0 -0
  75. data/test/dummy/tmp/cache/assets/development/sprockets/b04e4334658d0126de1cb39dcd8b062f +0 -0
  76. data/test/dummy/tmp/cache/assets/development/sprockets/b3081c914d9ca4332c7bc691e46e9e72 +0 -0
  77. data/test/dummy/tmp/cache/assets/development/sprockets/ca056621a6e70c2cc40341a60d0820b0 +0 -0
  78. data/test/dummy/tmp/cache/assets/development/sprockets/d6fa42a82a7a232f9bae1108e45726de +0 -0
  79. data/test/dummy/tmp/cache/assets/development/sprockets/d8e31b2f676b02dfdf6cef42165373d3 +0 -0
  80. data/test/dummy/tmp/cache/assets/development/sprockets/f873bfac381915533ead2a0546e482f4 +0 -0
  81. data/test/dummy/tmp/cache/assets/development/sprockets/fe2a43ff0e654e41aac13b53e9087099 +0 -0
  82. data/test/helpers/leads_to_highrise/leads_helper_test.rb +0 -6
  83. data/test/lib/generators/leads_to_highrise/install_generator_test.rb +0 -16
  84. data/test/lib/generators/leads_to_highrise/lth_generator_test.rb +0 -16
  85. data/test/models/leads_to_highrise/lead_test.rb +0 -9
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OTNiNmZlM2QzMjJkMjdlZDY2NDg4NjlmZTUxMDkzMGQ3MjdmNzQ5Zg==
4
+ ZTQwMDlmOTM0OGE4Y2I1YTJjMzViMzg1NDI0YWRmZDQwZWE2MWJlOA==
5
5
  data.tar.gz: !binary |-
6
- MWI5ZjQ0ZTNiZWYxOGE5ODFhMTE0MWU3MjZhYjFhZmE2ZWE1Mzk1Nw==
6
+ NGQxMmQ2ZmZlZTNkMmI1MTFiMDhmYTFlMjAxZTVjMWFlZGU1NGU1OA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MGU3NDE4ZGVlZGI0NjYzZDM0NTVkM2I2NTVlNjlmOGIwOTA5MDcxMWI0MGI5
10
- OGQ4MWQzYWYwZDFhNWZmYzI5NWU4Mzg4MzhjMWZjNmFlNjc2NzNiMjk1ZTM0
11
- OGM3OGQ4ZmVkMzAzMzBiZDhmYTZlYzNkYmEwMDA5NmJmYmExZWU=
9
+ YWMyN2FhOGRjMDM4YmU4MGFjN2M0NTJkNWUyZmI2MzllOTU4MmYyNDdjNTBj
10
+ YTQxNTY4ZDFmNjE1MjhhNTJjMzUzNmRlNzk5Y2UzNDU1YWExYTIzNWVkNGZm
11
+ ODIyYzBkNThhNDEyNWI3YmQ3NWM3ZTkwODdlMWI1ZGM5MGFmNWE=
12
12
  data.tar.gz: !binary |-
13
- MTg0MjkyNzQwM2NiNzBjYzU5NjcyMGM5ZjhhYzkwMzA4ZWNlODU2ZTUwYTM1
14
- NGQ2NDQ1OGQxM2JlMmU3YmE4YjJhNDgzMDlhNzAwYzNhN2E1OTI4NTBhYzJl
15
- YjBiODgwOTRmYzdhOTEzNzMwYWJjYmJmMTJjZmFhY2EwMWI3YjQ=
13
+ ODVjODc2NzQ0YmQzNDNmMTZmMjM3NjAwMDQ3MjNhOTk0MWYzY2QxYWUxZGVk
14
+ ZWM2YmQzNGQzZTgyMzNjMWE0ODRmMjk4MjJiNWUxMWNhNGZkOTg2YzY3NWNi
15
+ ODI5Njc2MTQzYmMzZDljYmY3ZmQwNGJjYjI2YzAxMzcwZmQ2Njc=
data/README.rdoc ADDED
@@ -0,0 +1,3 @@
1
+ = LeadsToHighrise
2
+
3
+ This project rocks and uses MIT-LICENSE.
@@ -0,0 +1,88 @@
1
+ require 'highrise'
2
+ class LeadsController < ApplicationController
3
+ before_action :set_lead, only: [:show, :edit, :update, :destroy]
4
+
5
+ # GET /leads
6
+ def index
7
+ @leads = Lead.all
8
+ end
9
+
10
+ # GET /leads/1
11
+ def show
12
+ end
13
+
14
+ # GET /leads/new
15
+ def new
16
+ @lead = Lead.new
17
+ end
18
+
19
+ # GET /leads/1/edit
20
+ def edit
21
+ end
22
+
23
+ # POST /leads
24
+ def create
25
+ @lead = Lead.new(lead_params)
26
+
27
+ if @lead.save
28
+ redirect_to @lead, notice: 'Lead was successfully created.'
29
+ else
30
+ render :new
31
+ end
32
+ end
33
+
34
+ # PATCH/PUT /leads/1
35
+ def update
36
+ if @lead.update(lead_params)
37
+ redirect_to @lead, notice: 'Lead was successfully updated.'
38
+ else
39
+ render :edit
40
+ end
41
+ end
42
+
43
+ # DELETE /leads/1
44
+ def destroy
45
+ @lead.destroy
46
+ redirect_to leads_url, notice: 'Lead was successfully destroyed.'
47
+ end
48
+
49
+ def to_highrise
50
+ @lead = Lead.find(params[:id])
51
+ add_person @lead
52
+ end
53
+
54
+ private
55
+ def add_person(lead)
56
+ @lead = lead
57
+ Highrise::Base.site = current_user.highrise_site
58
+ Highrise::Base.user = current_user.highrise_user
59
+ Highrise::Base.format = :xml
60
+
61
+ p = Highrise::Person.new( first_name: @lead[:name],
62
+ last_name: @lead[:last_name],
63
+ title: @lead[:job_title],
64
+ company_name: @lead[:company],
65
+ contact_data: { email_addresses: [ { address: @lead[:emial]} ],
66
+ phone: @lead[:phone],
67
+ website: @lead[:website] })
68
+
69
+ if p.save
70
+ redirect_to root_path, notice: 'The contact has been sended to highrise'
71
+
72
+ else
73
+ redirect_to root_path, notice: 'error.'
74
+
75
+ end
76
+
77
+ end
78
+
79
+ # Use callbacks to share common setup or constraints between actions.
80
+ def set_lead
81
+ @lead = Lead.find(params[:id])
82
+ end
83
+
84
+ # Only allow a trusted parameter "white list" through.
85
+ def lead_params
86
+ params.require(:lead).permit(:name, :last_name, :email, :company, :job_title, :phone, :website)
87
+ end
88
+ end
@@ -0,0 +1,2 @@
1
+ module LeadsHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ class Lead < ActiveRecord::Base
2
+ end
@@ -1,34 +1,38 @@
1
- <%= link_to 'New Lead', new_lead_path %>
2
- <br>
3
- <table>
4
- <thead>
5
- <tr>
6
- <th>Name</th>
7
- <th>Last name</th>
8
- <th>Email</th>
9
- <th>Company</th>
10
- <th>Job title</th>
11
- <th>Phone</th>
12
- <th>Website</th>
13
- <th colspan="4"></th>
14
- </tr>
15
- </thead>
16
-
17
- <tbody>
18
- <% @leads.each do |lead| %>
19
- <tr>
20
- <td><%= lead.name %></td>
21
- <td><%= lead.last_name %></td>
22
- <td><%= lead.email %></td>
23
- <td><%= lead.company %></td>
24
- <td><%= lead.job_title %></td>
25
- <td><%= lead.phone %></td>
26
- <td><%= lead.website %></td>
27
- <td><%= link_to 'Show', lead %></td>
28
- <td><%= link_to 'Edit', edit_lead_path(lead) %></td>
29
- <td><%= link_to 'Destroy', lead, method: :delete, data: { confirm: 'Are you sure?' } %></td>
30
- <td><%= link_to 'Send To Highrise', to_highrise_path(lead) if user_signed_in? %></td>
31
- </tr>
32
- <% end %>
33
- </tbody>
34
- </table>
1
+ <h1>Listing leads</h1>
2
+
3
+ <table>
4
+ <thead>
5
+ <tr>
6
+ <th>Name</th>
7
+ <th>Last name</th>
8
+ <th>Email</th>
9
+ <th>Company</th>
10
+ <th>Job title</th>
11
+ <th>Phone</th>
12
+ <th>Website</th>
13
+ <th colspan="3"></th>
14
+ </tr>
15
+ </thead>
16
+
17
+ <tbody>
18
+ <% @leads.each do |lead| %>
19
+ <tr>
20
+ <td><%= lead.name %></td>
21
+ <td><%= lead.last_name %></td>
22
+ <td><%= lead.email %></td>
23
+ <td><%= lead.company %></td>
24
+ <td><%= lead.job_title %></td>
25
+ <td><%= lead.phone %></td>
26
+ <td><%= lead.website %></td>
27
+ <td><%= link_to 'Show', lead %></td>
28
+ <td><%= link_to 'Edit', edit_lead_path(lead) %></td>
29
+ <td><%= link_to 'Destroy', lead, method: :delete, data: { confirm: 'Are you sure?' } %></td>
30
+ <td><%= link_to 'Send to Highrise', to_highrise_path(lead) if user_signed_in? %></td>
31
+ </tr>
32
+ <% end %>
33
+ </tbody>
34
+ </table>
35
+
36
+ <br>
37
+
38
+ <%= link_to 'New Lead', new_lead_path %>
data/config/routes.rb CHANGED
@@ -1,13 +1,4 @@
1
- LeadsToHighrise::Engine.routes.draw do
2
- get '/leads', to: 'leads#index', as: 'leads'
3
- post '/leads', to: 'leads#create'
4
- get '/leads/new', to: 'leads#new', as: 'new_lead'
5
- get '/leads/:id/edit', to: 'leads#edit', as: 'edit_lead'
6
- get '/leads/:id', to: 'leads#show', as: 'lead'
7
- patch '/leads/:id', to: 'leads#update'
8
- put '/leads/:id', to: 'leads#update'
9
- get '/leads/:id/delete', to: 'leads#destroy', as: 'delete_lead'
10
- get '/leads/to_highrise/:id', to: "leads#to_highrise", as: "to_highrise"
1
+ Rails.application.routes.draw do
2
+ resources :leads
3
+ get '/leads/:id/to_highrise', to: 'leads#to_highrise', as: "to_highrise"
11
4
  end
12
-
13
- #mount LeadsToHighrise::Engine => "/leads_to_highrise"
@@ -1,6 +1,6 @@
1
- class CreateLeadsToHighriseLeads < ActiveRecord::Migration
1
+ class CreateLeads < ActiveRecord::Migration
2
2
  def change
3
- create_table :leads_to_highrise_leads do |t|
3
+ create_table :leads do |t|
4
4
  t.string :name
5
5
  t.string :last_name
6
6
  t.string :email
@@ -3,25 +3,10 @@ module LeadsToHighrise
3
3
  module Generators
4
4
  class InstallGenerator < ::Rails::Generators::Base
5
5
  source_root File.expand_path('../templates', __FILE__)
6
- #argument :layout_name, :type => :string, :default => 'application', :banner => 'layout_name'
7
-
8
- def copy_views
9
- copy_file "_form.html.erb", "app/views/leads_to_highrise/lead/_form.html.erb"
10
- copy_file "_lead.html.erb", "app/views/leads_to_highrise/lead/_lead.html.erb"
11
- copy_file "edit.html.erb", "app/views/leads_to_highrise/lead/edit.html.erb"
12
- copy_file "index.html.erb", "app/views/leads_to_highrise/lead/index.html.erb"
13
- copy_file "new.html.erb", "app/views/leads_to_highrise/lead/new.html.erb"
14
- copy_file "show.html.erb", "app/views/leads_to_highrise/lead/show.html.erb"
15
- end
16
-
17
6
  def copy_migration
18
- copy_file "20140416000345_create_leads_to_highrise_leads.rb", "db/migrate/20140416000345_create_leads_to_highrise_leads.rb"
19
- copy_file "20140416021234_add_highrise_site_and_highrise_user_to_user.rb", "db/migrate/20140416021234_add_highrise_site_and_highrise_user_to_user.rb"
20
- end
21
-
22
- def setup_routes
23
- route('mount LeadsToHighrise::Engine => "/leads_to_highrise"')
7
+ copy_file "20140417073703_create_leads.rb", "db/migrate/20140417073703_create_leads.rb"
8
+ copy_file "20140417074432_add_highrise_site_and_highrise_user_to_user.rb", "db/migrate/20140417074432_add_highrise_site_and_highrise_user_to_user.rb"
24
9
  end
25
10
  end
26
11
  end
27
- end
12
+ end
@@ -1,6 +1,6 @@
1
- class CreateLeadsToHighriseLeads < ActiveRecord::Migration
1
+ class CreateLeads < ActiveRecord::Migration
2
2
  def change
3
- create_table :leads_to_highrise_leads do |t|
3
+ create_table :leads do |t|
4
4
  t.string :name
5
5
  t.string :last_name
6
6
  t.string :email
@@ -1,8 +1,5 @@
1
1
  require 'devise'
2
-
3
2
  module LeadsToHighrise
4
3
  class Engine < ::Rails::Engine
5
- isolate_namespace LeadsToHighrise
6
- engine_name 'leadstohighrise'
7
4
  end
8
5
  end
@@ -1,3 +1,3 @@
1
1
  module LeadsToHighrise
2
- VERSION = "0.1.9"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -0,0 +1,49 @@
1
+ require 'test_helper'
2
+
3
+ class LeadsControllerTest < ActionController::TestCase
4
+ setup do
5
+ @lead = leads(:one)
6
+ end
7
+
8
+ test "should get index" do
9
+ get :index
10
+ assert_response :success
11
+ assert_not_nil assigns(:leads)
12
+ end
13
+
14
+ test "should get new" do
15
+ get :new
16
+ assert_response :success
17
+ end
18
+
19
+ test "should create lead" do
20
+ assert_difference('Lead.count') do
21
+ post :create, lead: { company: @lead.company, email: @lead.email, job_title: @lead.job_title, last_name: @lead.last_name, name: @lead.name, phone: @lead.phone, website: @lead.website }
22
+ end
23
+
24
+ assert_redirected_to lead_path(assigns(:lead))
25
+ end
26
+
27
+ test "should show lead" do
28
+ get :show, id: @lead
29
+ assert_response :success
30
+ end
31
+
32
+ test "should get edit" do
33
+ get :edit, id: @lead
34
+ assert_response :success
35
+ end
36
+
37
+ test "should update lead" do
38
+ patch :update, id: @lead, lead: { company: @lead.company, email: @lead.email, job_title: @lead.job_title, last_name: @lead.last_name, name: @lead.name, phone: @lead.phone, website: @lead.website }
39
+ assert_redirected_to lead_path(assigns(:lead))
40
+ end
41
+
42
+ test "should destroy lead" do
43
+ assert_difference('Lead.count', -1) do
44
+ delete :destroy, id: @lead
45
+ end
46
+
47
+ assert_redirected_to leads_path
48
+ end
49
+ end
@@ -7,7 +7,8 @@
7
7
  <%= csrf_meta_tags %>
8
8
  </head>
9
9
  <body>
10
-
10
+ <p class="notice"><%= notice %></p>
11
+ <p class="alert"><%= alert %></p>
11
12
  <%= yield %>
12
13
 
13
14
  </body>
@@ -4,7 +4,7 @@ Devise.setup do |config|
4
4
  # The secret key used by Devise. Devise uses this key to generate
5
5
  # random tokens. Changing this key will render invalid all existing
6
6
  # confirmation, reset password and unlock tokens in the database.
7
- # config.secret_key = '9c2c8da5fad279fc817d9cedd26b011369bf1781cc61752df6f11becc1dfa997b191f203013edffef25211f70e0d133d1ca62855a9d48eddc972cb2bcbee4230'
7
+ # config.secret_key = 'f513ec4c7a4c6861b04edc83837eb9470387e762da6b72e953533a3f39cddb0f188ee30fa8b84f2d3f067a496dd4ed7a0c5ff8f7da53246215b280d6fa092991'
8
8
 
9
9
  # ==> Mailer Configuration
10
10
  # Configure the e-mail address which will be shown in Devise::Mailer,
@@ -97,7 +97,7 @@ Devise.setup do |config|
97
97
  config.stretches = Rails.env.test? ? 1 : 10
98
98
 
99
99
  # Setup a pepper to generate the encrypted password.
100
- # config.pepper = '4cd915f08ac0f6a07e61ea089f4b593cb747a1054e60efe18aeb5cb89ea2f89dfb3ef785d25b33e2bfc0e69e4529782344e93a5068809e0a8f2fd71ed48450b6'
100
+ # config.pepper = '985df728db4fb3d6ca8ca55878ec81bf385fb0d48ef443597400c319f4dfd2e532f185d146fcab2525c1b0668915edf285b2c795a135a8ce42d1378e28fce1e5'
101
101
 
102
102
  # ==> Configuration for :confirmable
103
103
  # A period that the user is allowed to access the website even without
@@ -1,5 +1,58 @@
1
1
  Rails.application.routes.draw do
2
- mount LeadsToHighrise::Engine => "/leads_to_highrise"
3
2
  devise_for :users
4
- root "leads_to_highrise/leads#index"
3
+ root 'leads#index'
4
+ # The priority is based upon order of creation: first created -> highest priority.
5
+ # See how all your routes lay out with "rake routes".
6
+
7
+ # You can have the root of your site routed with "root"
8
+ # root 'welcome#index'
9
+
10
+ # Example of regular route:
11
+ # get 'products/:id' => 'catalog#view'
12
+
13
+ # Example of named route that can be invoked with purchase_url(id: product.id)
14
+ # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
15
+
16
+ # Example resource route (maps HTTP verbs to controller actions automatically):
17
+ # resources :products
18
+
19
+ # Example resource route with options:
20
+ # resources :products do
21
+ # member do
22
+ # get 'short'
23
+ # post 'toggle'
24
+ # end
25
+ #
26
+ # collection do
27
+ # get 'sold'
28
+ # end
29
+ # end
30
+
31
+ # Example resource route with sub-resources:
32
+ # resources :products do
33
+ # resources :comments, :sales
34
+ # resource :seller
35
+ # end
36
+
37
+ # Example resource route with more complex sub-resources:
38
+ # resources :products do
39
+ # resources :comments
40
+ # resources :sales do
41
+ # get 'recent', on: :collection
42
+ # end
43
+ # end
44
+
45
+ # Example resource route with concerns:
46
+ # concern :toggleable do
47
+ # post 'toggle'
48
+ # end
49
+ # resources :posts, concerns: :toggleable
50
+ # resources :photos, concerns: :toggleable
51
+
52
+ # Example resource route within a namespace:
53
+ # namespace :admin do
54
+ # # Directs /admin/products/* to Admin::ProductsController
55
+ # # (app/controllers/admin/products_controller.rb)
56
+ # resources :products
57
+ # end
5
58
  end