billingsystem-remote 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +12 -2
- data/app/controllers/frontend/users_controller.rb +1 -1
- data/lib/billingsystem-remote.rb +2 -2
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -12,7 +12,7 @@ Hands a specific amount of control to Billingsystem so that it can operate upon
|
|
12
12
|
|
13
13
|
== SYNOPSIS:
|
14
14
|
|
15
|
-
This gem adds a controller called Frontend::UsersController to your app. The remote app (in this case, Billingsystem) must send an API
|
15
|
+
This gem adds a controller called Frontend::UsersController to your app. The remote app (in this case, Billingsystem) must send an API using HTTP Basic Auth credentials and the preferred username and password.
|
16
16
|
|
17
17
|
Step 1. Create your predefined key
|
18
18
|
|
@@ -25,11 +25,21 @@ Step 2. Create a new file called config/initializers/billingsystem-remote.rb:
|
|
25
25
|
module BillingSystem
|
26
26
|
module Remote
|
27
27
|
class Config
|
28
|
-
|
28
|
+
# username and password for HTTP Basic auth.
|
29
|
+
USERNAME = "1abc927b5b4f35f517983599ccc86c64"
|
30
|
+
PASSWORD = "e9510b9e7c47275376d1efd4fd75f680"
|
29
31
|
end
|
30
32
|
end
|
31
33
|
end
|
32
34
|
|
35
|
+
Step 3. Add the following route to your config/routes.rb:
|
36
|
+
|
37
|
+
# begin billingsystem-remote
|
38
|
+
map.namespace :frontend do |frontend|
|
39
|
+
frontend.resources :users
|
40
|
+
end
|
41
|
+
# end billingsystem-remote
|
42
|
+
|
33
43
|
== REQUIREMENTS:
|
34
44
|
|
35
45
|
- Rails, this gem is tested on 2.3.14.
|
@@ -10,7 +10,7 @@ class Frontend::UsersController < ApplicationController
|
|
10
10
|
respond_to do |format|
|
11
11
|
if @user.save
|
12
12
|
format.xml do
|
13
|
-
render :xml => @user, :status => :created, :location => @user
|
13
|
+
render :xml => @user, :status => :created, :location => [:frontend, @user]
|
14
14
|
end
|
15
15
|
else
|
16
16
|
format.xml do
|
data/lib/billingsystem-remote.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: billingsystem-remote
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Commander Johnson
|