spine-rails 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/javascripts/spine/list.js +3 -2
- data/app/assets/javascripts/spine/route.js +1 -1
- data/app/assets/javascripts/spine/tabs.js +1 -1
- data/lib/generators/spine/new/new_generator.rb +4 -0
- data/lib/generators/spine/new/templates/index.coffee.erb +0 -3
- data/lib/generators/spine/new/templates/view.coffee.erb +3 -0
- data/lib/generators/spine/scaffold/templates/controller.coffee.erb +18 -6
- data/lib/generators/spine/scaffold/templates/edit.jst.erb +3 -0
- data/lib/generators/spine/scaffold/templates/new.jst.erb +3 -0
- data/lib/generators/spine/scaffold/templates/show.jst.erb +1 -1
- data/lib/spine/rails/version.rb +1 -1
- metadata +66 -35
@@ -27,6 +27,10 @@ module Spine
|
|
27
27
|
def create_app_file
|
28
28
|
template "index.coffee.erb", "app/assets/javascripts/#{app_name}/index.js.coffee"
|
29
29
|
end
|
30
|
+
|
31
|
+
def create_lib_file
|
32
|
+
template "view.coffee.erb", "app/assets/javascripts/#{app_name}/lib/view.js.coffee"
|
33
|
+
end
|
30
34
|
|
31
35
|
def add_spine_app_to_application
|
32
36
|
source = "app/assets/javascripts/application.js"
|
@@ -8,6 +8,7 @@ $.fn.item = ->
|
|
8
8
|
|
9
9
|
class New extends Spine.Controller
|
10
10
|
events:
|
11
|
+
'click [data-type=back]': 'back'
|
11
12
|
'submit form': 'submit'
|
12
13
|
|
13
14
|
constructor: ->
|
@@ -15,8 +16,11 @@ class New extends Spine.Controller
|
|
15
16
|
@active @render
|
16
17
|
|
17
18
|
render: ->
|
18
|
-
@html
|
19
|
-
|
19
|
+
@html @view('<%= controller_name %>/new')
|
20
|
+
|
21
|
+
back: ->
|
22
|
+
@navigate '/<%= controller_name %>'
|
23
|
+
|
20
24
|
submit: (e) ->
|
21
25
|
e.preventDefault()
|
22
26
|
<%= model_name %> = <%= model_class %>.fromForm(e.target).save()
|
@@ -24,6 +28,7 @@ class New extends Spine.Controller
|
|
24
28
|
|
25
29
|
class Edit extends Spine.Controller
|
26
30
|
events:
|
31
|
+
'click [data-type=back]': 'back'
|
27
32
|
'submit form': 'submit'
|
28
33
|
|
29
34
|
constructor: ->
|
@@ -36,8 +41,11 @@ class Edit extends Spine.Controller
|
|
36
41
|
@render()
|
37
42
|
|
38
43
|
render: ->
|
39
|
-
@html
|
40
|
-
|
44
|
+
@html @view('<%= controller_name %>/edit')(@item)
|
45
|
+
|
46
|
+
back: ->
|
47
|
+
@navigate '/<%= controller_name %>'
|
48
|
+
|
41
49
|
submit: (e) ->
|
42
50
|
e.preventDefault()
|
43
51
|
@item.fromForm(e.target).save()
|
@@ -45,6 +53,7 @@ class Edit extends Spine.Controller
|
|
45
53
|
|
46
54
|
class Show extends Spine.Controller
|
47
55
|
events:
|
56
|
+
'click [bata-type=edit]': 'edit'
|
48
57
|
'click [data-type=back]': 'back'
|
49
58
|
|
50
59
|
constructor: ->
|
@@ -57,7 +66,10 @@ class Show extends Spine.Controller
|
|
57
66
|
@render()
|
58
67
|
|
59
68
|
render: ->
|
60
|
-
@html
|
69
|
+
@html @view('<%= controller_name %>/show')(@item)
|
70
|
+
|
71
|
+
edit: ->
|
72
|
+
@navigate '/<%= controller_name %>', @item.id, 'edit'
|
61
73
|
|
62
74
|
back: ->
|
63
75
|
@navigate '/<%= controller_name %>'
|
@@ -76,7 +88,7 @@ class Index extends Spine.Controller
|
|
76
88
|
|
77
89
|
render: =>
|
78
90
|
<%= controller_name %> = <%= model_class %>.all()
|
79
|
-
@html
|
91
|
+
@html @view('<%= controller_name %>/index')(<%= controller_name %>: <%= controller_name %>)
|
80
92
|
|
81
93
|
edit: (e) ->
|
82
94
|
item = $(e.target).item()
|
@@ -1,5 +1,7 @@
|
|
1
1
|
<h1>Edit <%= model_class %></h1>
|
2
2
|
|
3
|
+
<a data-type="back">Back</a>
|
4
|
+
|
3
5
|
<form>
|
4
6
|
<% fields.each do |field| %>
|
5
7
|
<label>
|
@@ -8,6 +10,7 @@
|
|
8
10
|
type="text" name="<%= field %>"
|
9
11
|
value="<%%= @<%= field %> %>" required
|
10
12
|
<%- if field == fields[0] %> autofocus<% end %>>
|
13
|
+
<br />
|
11
14
|
</label>
|
12
15
|
<% end %>
|
13
16
|
<button>Edit</button>
|
@@ -1,5 +1,7 @@
|
|
1
1
|
<h1>New <%= model_class %></h1>
|
2
2
|
|
3
|
+
<a data-type="back">Back</a>
|
4
|
+
|
3
5
|
<form>
|
4
6
|
<% fields.each do |field| %>
|
5
7
|
<label>
|
@@ -8,6 +10,7 @@
|
|
8
10
|
type="text" name="<%= field %>"
|
9
11
|
value="<%%= @<%= field %> %>" required
|
10
12
|
<%- if field == fields[0] %> autofocus<% end %>>
|
13
|
+
<br />
|
11
14
|
</label>
|
12
15
|
<% end %>
|
13
16
|
<button>Create</button>
|
data/lib/spine/rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,45 +1,63 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: spine-rails
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 13
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 9
|
10
|
+
version: 0.0.9
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Alex MacCaw
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
|
18
|
+
date: 2011-11-15 00:00:00 -08:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
15
22
|
name: rails
|
16
|
-
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
17
25
|
none: false
|
18
|
-
requirements:
|
19
|
-
- -
|
20
|
-
- !ruby/object:Gem::Version
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 3
|
32
|
+
- 1
|
33
|
+
- 0
|
21
34
|
version: 3.1.0
|
22
35
|
type: :runtime
|
23
|
-
|
24
|
-
|
25
|
-
- !ruby/object:Gem::Dependency
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
26
38
|
name: bundler
|
27
|
-
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
28
41
|
none: false
|
29
|
-
requirements:
|
30
|
-
- -
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 3
|
46
|
+
segments:
|
47
|
+
- 0
|
48
|
+
version: "0"
|
33
49
|
type: :development
|
34
|
-
|
35
|
-
version_requirements: *70224443988460
|
50
|
+
version_requirements: *id002
|
36
51
|
description: This gem provides Spine for your Rails 3 application.
|
37
|
-
email:
|
52
|
+
email:
|
38
53
|
- info@eribium.org
|
39
54
|
executables: []
|
55
|
+
|
40
56
|
extensions: []
|
57
|
+
|
41
58
|
extra_rdoc_files: []
|
42
|
-
|
59
|
+
|
60
|
+
files:
|
43
61
|
- .gitignore
|
44
62
|
- Gemfile
|
45
63
|
- Gemfile.lock
|
@@ -61,6 +79,7 @@ files:
|
|
61
79
|
- lib/generators/spine/model/templates/model.coffee.erb
|
62
80
|
- lib/generators/spine/new/new_generator.rb
|
63
81
|
- lib/generators/spine/new/templates/index.coffee.erb
|
82
|
+
- lib/generators/spine/new/templates/view.coffee.erb
|
64
83
|
- lib/generators/spine/scaffold/scaffold_generator.rb
|
65
84
|
- lib/generators/spine/scaffold/templates/controller.coffee.erb
|
66
85
|
- lib/generators/spine/scaffold/templates/edit.jst.erb
|
@@ -77,29 +96,41 @@ files:
|
|
77
96
|
- lib/spine/rails/engine.rb
|
78
97
|
- lib/spine/rails/version.rb
|
79
98
|
- spine-rails.gemspec
|
99
|
+
has_rdoc: true
|
80
100
|
homepage: http://rubygems.org/gems/spine-rails
|
81
101
|
licenses: []
|
102
|
+
|
82
103
|
post_install_message:
|
83
104
|
rdoc_options: []
|
84
|
-
|
105
|
+
|
106
|
+
require_paths:
|
85
107
|
- lib
|
86
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
108
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
87
109
|
none: false
|
88
|
-
requirements:
|
89
|
-
- -
|
90
|
-
- !ruby/object:Gem::Version
|
91
|
-
|
92
|
-
|
110
|
+
requirements:
|
111
|
+
- - ">="
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
hash: 3
|
114
|
+
segments:
|
115
|
+
- 0
|
116
|
+
version: "0"
|
117
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
118
|
none: false
|
94
|
-
requirements:
|
95
|
-
- -
|
96
|
-
- !ruby/object:Gem::Version
|
119
|
+
requirements:
|
120
|
+
- - ">="
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
hash: 23
|
123
|
+
segments:
|
124
|
+
- 1
|
125
|
+
- 3
|
126
|
+
- 6
|
97
127
|
version: 1.3.6
|
98
128
|
requirements: []
|
129
|
+
|
99
130
|
rubyforge_project: spine-rails
|
100
|
-
rubygems_version: 1.
|
131
|
+
rubygems_version: 1.6.2
|
101
132
|
signing_key:
|
102
133
|
specification_version: 3
|
103
134
|
summary: Use Spine with Rails 3
|
104
135
|
test_files: []
|
105
|
-
|
136
|
+
|