dojo_rails 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.
- data/README.md +34 -23
- data/dojo_rails.gemspec +1 -1
- data/lib/dojo_rails/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -23,43 +23,52 @@ Or install it yourself as:
|
|
23
23
|
To use dojo in your application
|
24
24
|
|
25
25
|
Add the gem into your Gemfile
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
26
|
+
|
27
|
+
group :assets do
|
28
|
+
# ...
|
29
|
+
gem 'dojo_rails'
|
30
|
+
end
|
30
31
|
|
31
32
|
then execute
|
32
|
-
|
33
|
+
|
34
|
+
$ bundle
|
33
35
|
|
34
36
|
Create a new js file called dojoConfig.js inside app/assets/javascripts
|
35
37
|
Add this configuration, you can add as many options based upon your requirement
|
36
|
-
|
38
|
+
|
39
|
+
dojoConfig = {parseOnLoad: true}
|
37
40
|
|
38
41
|
Make changes to your application.js
|
39
42
|
Require the dojo toolkit library
|
40
|
-
|
41
|
-
//= require
|
43
|
+
|
44
|
+
//= require dojoConfig
|
45
|
+
//= require dojo/dojo
|
42
46
|
|
43
47
|
Then remove the following lines
|
44
|
-
|
45
|
-
//= require
|
48
|
+
|
49
|
+
//= require jquery
|
50
|
+
//= require jquery_ujs
|
51
|
+
|
46
52
|
It is not required anymore. We are going to use dojo, dijit completely.
|
47
53
|
|
48
54
|
Make changes to your application.css
|
49
55
|
Require the dijit and claro css
|
50
|
-
|
51
|
-
*= require
|
56
|
+
|
57
|
+
*= require dijit
|
58
|
+
*= require claro/claro
|
52
59
|
|
53
60
|
Dojo has themes available as inbuilt files. In this above code, we are using theme "claro". Other themes are nihilo, soria, tundra.
|
54
61
|
|
55
62
|
In application layout file add these inside head
|
56
|
-
|
57
|
-
<%=
|
58
|
-
<%=
|
63
|
+
|
64
|
+
<%= stylesheet_link_tag "application" %>
|
65
|
+
<%= javascript_include_tag "application" %>
|
66
|
+
<%= csrf_meta_tags %>
|
59
67
|
|
60
68
|
Another important thing to note is, we need to set body of the layout with the theme class then only the loaded theme will reflects in action.
|
61
69
|
Here, we need to add class "claro" to body
|
62
|
-
|
70
|
+
|
71
|
+
<body class="claro">
|
63
72
|
|
64
73
|
We are done with integration of dojo, dijit toolkit in rails application.
|
65
74
|
|
@@ -67,15 +76,17 @@ Dijit datetextbox integration sample
|
|
67
76
|
In this example, we are going to integrate the calendar in our rails application
|
68
77
|
|
69
78
|
Add the script in view file
|
70
|
-
|
71
|
-
|
72
|
-
|
79
|
+
|
80
|
+
<script>
|
81
|
+
require(["dojo/parser", "dijit/form/DateTextBox"]);
|
82
|
+
</script>
|
73
83
|
|
74
84
|
Then add the below html
|
75
|
-
|
76
|
-
<
|
77
|
-
|
78
|
-
|
85
|
+
|
86
|
+
<label for="date1">Drop down Date box:</label>
|
87
|
+
<input type="text" name="date1" id="date1" value="2005-12-30"
|
88
|
+
data-dojo-type="dijit/form/DateTextBox"
|
89
|
+
required="true" />
|
79
90
|
|
80
91
|
Reload the page to see datetextbox calendar in action.
|
81
92
|
|
data/dojo_rails.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["reachme.vadivelan@gmail.com"]
|
11
11
|
spec.description = %q{Dojo Dijit javascript framework on rails}
|
12
12
|
spec.summary = %q{Use dojo dijit in rails and gets the advantages of AMD browser compatibility and more}
|
13
|
-
spec.homepage = ""
|
13
|
+
spec.homepage = "https://github.com/vadivelan-k/dojo_rails"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
data/lib/dojo_rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dojo_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -2285,7 +2285,7 @@ files:
|
|
2285
2285
|
- vendor/assets/stylesheets/tundra/layout/TabContainer_rtl.css
|
2286
2286
|
- vendor/assets/stylesheets/tundra/tundra.css
|
2287
2287
|
- vendor/assets/stylesheets/tundra/tundra_rtl.css
|
2288
|
-
homepage:
|
2288
|
+
homepage: https://github.com/vadivelan-k/dojo_rails
|
2289
2289
|
licenses:
|
2290
2290
|
- MIT
|
2291
2291
|
post_install_message:
|