djr 0.0.2 → 0.0.3
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.
- data/Gemfile +0 -6
- data/README.rdoc +30 -1
- data/lib/djr/version.rb +1 -1
- metadata +3 -3
data/Gemfile
CHANGED
@@ -1,15 +1,9 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
|
-
# Add dependencies required to use your gem here.
|
3
|
-
# Example:
|
4
|
-
# gem "activesupport", ">= 2.3.5"
|
5
2
|
|
6
3
|
gem "rails", "~> 3.2.0"
|
7
4
|
|
8
|
-
# Add dependencies to develop your gem here.
|
9
|
-
# Include everything needed to run rake, tests, features, etc.
|
10
5
|
group :development do
|
11
6
|
gem "rspec", "~> 2.8.0"
|
12
7
|
gem "rdoc", "3.12"
|
13
8
|
gem "bundler", "1.0.21"
|
14
|
-
# gem "jeweler", "~> 1.8.3"
|
15
9
|
end
|
data/README.rdoc
CHANGED
@@ -1,6 +1,35 @@
|
|
1
1
|
= djr
|
2
2
|
|
3
|
-
|
3
|
+
DJR will generate the JavaScript code from Rails Controllers to allow browsers to securely call into Ruby code almost as if it was running locally
|
4
|
+
|
5
|
+
## Getting started
|
6
|
+
|
7
|
+
Add it to your Gemfile with:
|
8
|
+
gem 'djr'
|
9
|
+
|
10
|
+
Run the bundle command to install it.
|
11
|
+
|
12
|
+
Configure assets in app/assets/application.js file:
|
13
|
+
|
14
|
+
//= require jquery
|
15
|
+
//= require djr
|
16
|
+
//= require_tree .
|
17
|
+
|
18
|
+
Import script in your pages:
|
19
|
+
|
20
|
+
<script type="text/javascript" charset="utf-8" src="/djr"></script>
|
21
|
+
|
22
|
+
In javascript, call your Controller like:
|
23
|
+
|
24
|
+
productsController = new ProductsController
|
25
|
+
productsController.save({
|
26
|
+
name: "IPhone 4s",
|
27
|
+
value: "500.00"
|
28
|
+
}, callbackFunction);
|
29
|
+
|
30
|
+
## Conventions
|
31
|
+
|
32
|
+
controller.action( dataAsJson, callbackFunction, errorHandler );
|
4
33
|
|
5
34
|
== Contributing to djr
|
6
35
|
|
data/lib/djr/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: djr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-02-20 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|
16
|
-
requirement: &
|
16
|
+
requirement: &2168470420 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: 3.1.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2168470420
|
25
25
|
description: DJR will generate the JavaScript code from Rails Controllers to allow
|
26
26
|
browsers to securely call into Ruby code almost as if it was running locally
|
27
27
|
email:
|