scajax 0.0.1 → 0.1.0
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 +6 -14
- data/README.md +92 -19
- data/lib/generators/scajax/scajax_generator.rb +1 -1
- data/lib/scajax/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
YzExMWEyNWNjMzY2ODJiNDk2YzdkNjBlMDljZmExMmUyOTNlNDJiYTdiN2Uz
|
10
|
-
NTkwOTBiNDY1Njc5NzkzYjk2ODJmYzQ0MzkzMWY3OTllNWI2ZmMyZDRmYjA2
|
11
|
-
ODdlMTBmZWM1ODM4MDkyNzIzMzU2MWQyNWIzOWY4ODJmMWZjOTM=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
Y2RkNDNhZTkyYmJiYzM2YWZmZWUwMDRhOGVkYmRhYzYxOGYwNTg3ZGQ5ZWQy
|
14
|
-
ZDAwMzYxNmMwNTBkZGU5ZjlkYTg5Njg3NTFlMGUyZmRmZGMyYzFiMDkwOTc5
|
15
|
-
YmU3MGEzYWI3MzcxZWZlMmM3ODUwNzlkOWM5M2Y0ZGE2MjA5MGU=
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e6c176914fbad7205b4d52c6ea3203b201b145ba
|
4
|
+
data.tar.gz: a1a4ca11e81908a18f4af9bb232360a20c597347
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b923d93dc16ccb2b9bae89dd6c5890c51928f0191f2a000455dfbb35f07084ff8321b90236d8a75b0dd5bcacef7914741d44c712e5be2ccc474d12fbdf85de7e
|
7
|
+
data.tar.gz: 0b8da916e117b4fba99652fc0dec4d55d960b21e48d08321ca6ace260fbb54566e252e533c61e4f44f15ffaf66b2120cd86e8545c98439317ea123801aebab3a
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
# Scajax [](https://travis-ci.org/menuitem/scajax)
|
1
|
+
# Scajax [](https://travis-ci.org/menuitem/scajax) [](http://badge.fury.io/rb/scajax)
|
2
2
|
|
3
|
-
This gem adds basic ajax functionality to generated scaffold in rails.
|
3
|
+
This gem quickly adds a basic ajax functionality to generated scaffold in rails.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -8,50 +8,123 @@ Add this line to your application's Gemfile:
|
|
8
8
|
|
9
9
|
gem 'scajax'
|
10
10
|
|
11
|
-
or for latest version of the gem add:
|
11
|
+
or for the latest version of the gem add:
|
12
12
|
|
13
13
|
gem 'scajax', git: 'git@github.com:menuitem/scajax.git'
|
14
14
|
|
15
|
-
And then execute:
|
15
|
+
And then execute bundle:
|
16
16
|
|
17
17
|
$ bundle
|
18
18
|
|
19
|
-
Also you can
|
19
|
+
Also you can install it yourself in your system gems as:
|
20
20
|
|
21
21
|
$ gem install scajax
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
-
|
25
|
+
$ rails g scajax [RESOURCE_NAME]
|
26
26
|
|
27
|
-
Example:
|
28
27
|
|
29
|
-
|
28
|
+
### Quick Simple Example:
|
30
29
|
|
31
|
-
gem 'scajax'
|
32
30
|
|
33
|
-
|
31
|
+
1. Add scajax to your application's Gemfile:
|
34
32
|
|
35
|
-
|
33
|
+
gem 'scajax'
|
36
34
|
|
37
|
-
|
35
|
+
2. Run 'bundle' to install this gem in your project:
|
38
36
|
|
39
|
-
|
37
|
+
$ bundle
|
40
38
|
|
41
|
-
Generate new scaffold called e.g posts:
|
39
|
+
3. Generate new scaffold called e.g. posts:
|
42
40
|
|
43
|
-
|
41
|
+
$ rails generate scaffold post title body:text published:boolean
|
44
42
|
|
45
|
-
Don't forget to run migration:
|
43
|
+
4. Don't forget to run migration:
|
46
44
|
|
47
|
-
|
45
|
+
$ rake db:migrate
|
48
46
|
|
49
|
-
Generate ajax for posts scaffold with scajax generator
|
47
|
+
5. Generate ajax for posts scaffold with scajax generator:
|
50
48
|
|
51
|
-
|
49
|
+
$ rails g scajax post
|
52
50
|
|
53
51
|
Open your project in a browser.
|
54
52
|
|
53
|
+
### Quick Example with twitter-bootstrap:
|
54
|
+
|
55
|
+
1. Add to your application's Gemfile:
|
56
|
+
|
57
|
+
gem 'scajax'
|
58
|
+
gem 'twitter-bootstrap-rails'
|
59
|
+
|
60
|
+
2. Run 'bundle' to install gems in your project:
|
61
|
+
|
62
|
+
$ bundle
|
63
|
+
|
64
|
+
3. Install twitter-bootstrap:
|
65
|
+
|
66
|
+
$ rails generate bootstrap:install static
|
67
|
+
|
68
|
+
4. Generate new scaffold called e.g. posts:
|
69
|
+
|
70
|
+
$ rails generate scaffold post title body:text published:boolean --no-stylesheets
|
71
|
+
|
72
|
+
5. Don't forget to run migration:
|
73
|
+
|
74
|
+
$ rake db:migrate
|
75
|
+
|
76
|
+
6. Generate boootstrap themed for posts
|
77
|
+
|
78
|
+
$ rails g bootstrap:themed posts
|
79
|
+
|
80
|
+
7. Generate ajax for posts scaffold with scajax generator
|
81
|
+
|
82
|
+
$ rails g scajax post
|
83
|
+
|
84
|
+
Open your project in a browser.
|
85
|
+
|
86
|
+
(8) If you have somehow file 'scaffolds.css.scss' and you don't use it just delete it:
|
87
|
+
|
88
|
+
$ rm app/assets/stylesheets/scaffolds.css.scss
|
89
|
+
|
90
|
+
Refresh your browser (F5).
|
91
|
+
|
92
|
+
### Quick Example with zurb-foundation:
|
93
|
+
|
94
|
+
1. Add to your application's Gemfile:
|
95
|
+
|
96
|
+
gem 'scajax'
|
97
|
+
gem 'zurb-foundation'
|
98
|
+
|
99
|
+
2. And run 'bundle' to install gems in your project:
|
100
|
+
|
101
|
+
$ bundle
|
102
|
+
|
103
|
+
3. Install zurb-foundation:
|
104
|
+
|
105
|
+
$ rails g foundation:install
|
106
|
+
|
107
|
+
4. Generate new scaffold called e.g. posts:
|
108
|
+
|
109
|
+
$ rails generate scaffold post title body:text published:boolean --no-styelsheets
|
110
|
+
|
111
|
+
5. Don't forget to run migration:
|
112
|
+
|
113
|
+
$ rake db:migrate
|
114
|
+
|
115
|
+
6. Generate ajax for posts scaffold with scajax generator:
|
116
|
+
|
117
|
+
$ rails g scajax post
|
118
|
+
|
119
|
+
Open your project in a browser.
|
120
|
+
|
121
|
+
(7) If you have somehow file 'scaffolds.css.scss' and you don't use it just delete it:
|
122
|
+
|
123
|
+
$ rm app/assets/stylesheets/scaffolds.css.scss
|
124
|
+
|
125
|
+
Refresh your browser (F5).
|
126
|
+
|
127
|
+
|
55
128
|
## Contributing
|
56
129
|
|
57
130
|
1. Fork it
|
@@ -116,7 +116,7 @@ class ScajaxGenerator < Rails::Generators::NamedBase
|
|
116
116
|
file_in_array = IO.readlines("app/views/#{plural_name}/index.html.erb")
|
117
117
|
start_copy, stop_copy = 0
|
118
118
|
file_in_array.each_index do |i|
|
119
|
-
if (file_in_array[i].include?("@#{plural_name.
|
119
|
+
if (file_in_array[i].include?("@#{plural_name}.each"))
|
120
120
|
start_copy = i+1
|
121
121
|
end
|
122
122
|
if (file_in_array[i].include?("<% end %>"))
|
data/lib/scajax/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scajax
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lucjan Stepien
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -28,14 +28,14 @@ dependencies:
|
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
@@ -80,12 +80,12 @@ require_paths:
|
|
80
80
|
- lib
|
81
81
|
required_ruby_version: !ruby/object:Gem::Requirement
|
82
82
|
requirements:
|
83
|
-
- -
|
83
|
+
- - '>='
|
84
84
|
- !ruby/object:Gem::Version
|
85
85
|
version: '0'
|
86
86
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
|
-
- -
|
88
|
+
- - '>='
|
89
89
|
- !ruby/object:Gem::Version
|
90
90
|
version: '0'
|
91
91
|
requirements: []
|