leads_to_highrise 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OTQyMGUxNjMyZGExNTMzMmNiNDAxYjM0OWU2M2U5MTVjYzM1ZTIzZQ==
4
+ MzM2YTg3MzRhYTU4NDg4OTFiMjZjMmEzMThiMTc1YzBmNjY0Yjk4OQ==
5
5
  data.tar.gz: !binary |-
6
- OTZhMjljZjU2OGVmZmRlZWVmMTk0NWRkMzc4MGQ4YTk3Mzc2ODAxOA==
6
+ MjBkZmUwNTFhMzVjMzJlZTdiNzY4Mjc0NjIwZjRhZTQ2NmUxZmY1ZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZmQ5ZWEyOTk4YmVhM2VhZjVkOWUzNjk5MzQyMGZhOWQ2NjFmOTk3MGJiMDc1
10
- Zjc4YzQzYjBkZDFlY2MwM2ZkZTkyYTUxMDVjNjYzZDA3ODMxNzUwZTUxZTU2
11
- MTkzODVmNTcwMjQ0ZjE4YmUzMjkzNTFkODg2MTk0MTcxMzVlZWU=
9
+ MjU5MGEyM2I3MDg1NWI2NWZiZjM5Yjg2YWRhNWUxNTUwYTkxZGY2OTQ3NjFk
10
+ M2Q0MDE1MDZkODliZjJmYjc1NjY2M2U0YzZlMzIyMjcyOTc0NzM2MDI2NjFh
11
+ OTc3YjFhYzc4ZjNhNzc4ZTk1OWYxMDhhNmVkZjg5NTRhNjMxY2I=
12
12
  data.tar.gz: !binary |-
13
- NjM4ZTE0NjE0ODA0ZWRkZTY5NDM0MDg4ZmVmZTE0YTczOTUzYWNiMzBiZDgw
14
- YmJlMWQyZjU0MTYxZDM4ZGM1NDgxMjVlYjRjMGY4MGQ5Mzc2MGQ4ZTcyNDI5
15
- MmE0OGFmMWVkYWMyNjgwODkwYTJkY2EzM2Y5MjgxMDVlZmY0OTI=
13
+ MjRhMzJiMTk4ZWJhN2EyOTczZWZmZjNmZjkyYjVmNzM3NThlN2MzMmE3ZGJm
14
+ YzA0MTgzYjM5NjlhNDhjMDMzMWU3NWFlMzk5MTY1MTQ0YzgxODdiZWI3YTdl
15
+ MzBlMmU5YWZlYTkyZDMyM2U4OGUxMzc4YzE2Y2Y4Nzg1NmI2OGU=
data/README.rdoc CHANGED
@@ -1,12 +1,12 @@
1
1
  = LeadsToHighrise
2
2
 
3
- Use this gem to send leads to highrise easily
3
+ Use this gem to send contacts to highrise easily
4
4
 
5
5
  =Dependencies
6
6
  *Devise
7
7
  *Highrise gem
8
8
 
9
- =Usage
9
+ =How to use
10
10
  *Add the gem
11
11
  ````
12
12
  gem 'devise'
@@ -14,8 +14,9 @@ gem 'leads_to_higrise'
14
14
  ```
15
15
 
16
16
  *Install Devise and generate a model(LTH uses the 'User' model by default).
17
- *Install LTH migrations ```rake ```
18
-
17
+ *Install LTH migrations ```rake leadstohighrise:install:migrations``` (this command line is big and confused, i know, i go fix it soon :) )
19
18
 
19
+ *Run```rake db:migrate```
20
+ *Add ```mount LeadsToHighrise::Engine => "/"``` to ```config/routes.rb```
20
21
 
21
22
  This project rocks and uses MIT-LICENSE.
@@ -45,6 +45,7 @@ module LeadsToHighrise
45
45
 
46
46
  # DELETE /leads/1
47
47
  def destroy
48
+ @lead = Lead.find(params[:id])
48
49
  @lead.destroy
49
50
  redirect_to leads_url, notice: 'Lead was successfully destroyed.'
50
51
  end
@@ -61,13 +62,13 @@ module LeadsToHighrise
61
62
  Highrise::Base.user = current_user.highrise_user
62
63
  Highrise::Base.format = :xml
63
64
 
64
- p = Highrise::Person.new( first_name: @lead[:name],
65
- last_name: @lead[:last_name],
66
- title: @lead[:job_title],
65
+ p = Highrise::Person.new( first_name: @lead[:name],
66
+ last_name: @lead[:last_name],
67
+ title: @lead[:job_title],
67
68
  company_name: @lead[:company],
68
69
  contact_data: { email_addresses: [ { address: @lead[:emial]} ],
69
- phone: @lead[:phone],
70
- website: @lead[:website] })
70
+ phone: @lead[:phone],
71
+ website: @lead[:website] })
71
72
 
72
73
  if p.save
73
74
  redirect_to main_app.root_path
@@ -27,7 +27,7 @@
27
27
  <td><%= link_to 'Show', lead %></td>
28
28
  <td><%= link_to 'Edit', edit_lead_path(lead) %></td>
29
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),%></td>
30
+ <td><%= link_to 'Send To Highrise', to_highrise_path(lead) if user_signed_in? %></td>
31
31
  </tr>
32
32
  <% end %>
33
33
  </tbody>
@@ -26,8 +26,8 @@
26
26
  <td><%= lead.website %></td>
27
27
  <td><%= link_to 'Show', lead %></td>
28
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)%></td>
29
+ <td><%= link_to 'Destroy', delete_lead_path(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
31
  </tr>
32
32
  <% end %>
33
33
  </tbody>
data/config/routes.rb CHANGED
@@ -1,4 +1,11 @@
1
1
  LeadsToHighrise::Engine.routes.draw do
2
- resources :leads
3
- get 'lead/to_highrise/:id', to: "leads#to_highrise", as: "to_highrise"
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"
4
11
  end
@@ -3,6 +3,5 @@ require 'devise'
3
3
  module LeadsToHighrise
4
4
  class Engine < ::Rails::Engine
5
5
  isolate_namespace LeadsToHighrise
6
- engine_name 'leadstohighrise'
7
6
  end
8
7
  end
@@ -1,3 +1,3 @@
1
1
  module LeadsToHighrise
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -2,4 +2,5 @@ Rails.application.routes.draw do
2
2
  devise_for :users
3
3
  mount LeadsToHighrise::Engine => "/leads_to_highrise"
4
4
  root "leads_to_highrise/leads#index"
5
+ #lth_resources
5
6
  end
Binary file
Binary file