dry_scaffold 0.3.6
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/CHANGELOG.textile +55 -0
- data/MIT-LICENSE +20 -0
- data/README.textile +473 -0
- data/Rakefile +54 -0
- data/TODO.textile +36 -0
- data/bin/dmodel +3 -0
- data/bin/dry_model +3 -0
- data/bin/dry_scaffold +3 -0
- data/bin/dscaffold +3 -0
- data/config/scaffold.yml +33 -0
- data/generators/dmodel/dmodel_generator.rb +15 -0
- data/generators/dry_model/USAGE +9 -0
- data/generators/dry_model/dry_model_generator.rb +134 -0
- data/generators/dry_model/prototypes/active_record_migration.rb +17 -0
- data/generators/dry_model/prototypes/active_record_model.rb +9 -0
- data/generators/dry_model/prototypes/fixture_data/active_record_fixtures.yml +3 -0
- data/generators/dry_model/prototypes/fixture_data/factory_girl_factories.rb +4 -0
- data/generators/dry_model/prototypes/fixture_data/machinist_blueprints.rb +8 -0
- data/generators/dry_model/prototypes/tests/rspec/unit_test.rb +9 -0
- data/generators/dry_model/prototypes/tests/shoulda/unit_test.rb +20 -0
- data/generators/dry_model/prototypes/tests/test_unit/unit_test.rb +15 -0
- data/generators/dry_model/templates/models/active_record_migration.rb +23 -0
- data/generators/dry_model/templates/models/active_record_model.rb +15 -0
- data/generators/dry_model/templates/models/fixture_data/active_record_fixtures.yml +6 -0
- data/generators/dry_model/templates/models/fixture_data/factory_girl_factories.rb +5 -0
- data/generators/dry_model/templates/models/fixture_data/machinist_blueprints.rb +9 -0
- data/generators/dry_model/templates/models/tests/rspec/unit_test.rb +11 -0
- data/generators/dry_model/templates/models/tests/shoulda/unit_test.rb +23 -0
- data/generators/dry_model/templates/models/tests/test_unit/unit_test.rb +17 -0
- data/generators/dry_scaffold/USAGE +11 -0
- data/generators/dry_scaffold/dry_scaffold_generator.rb +410 -0
- data/generators/dry_scaffold/prototypes/controllers/action_controller.rb +135 -0
- data/generators/dry_scaffold/prototypes/controllers/inherited_resources_controller.rb +25 -0
- data/generators/dry_scaffold/prototypes/controllers/tests/rspec/functional_test.rb +57 -0
- data/generators/dry_scaffold/prototypes/controllers/tests/shoulda/functional_test.rb +99 -0
- data/generators/dry_scaffold/prototypes/controllers/tests/test_unit/functional_test.rb +70 -0
- data/generators/dry_scaffold/prototypes/helpers/helper.rb +3 -0
- data/generators/dry_scaffold/prototypes/helpers/tests/rspec/unit_test.rb +9 -0
- data/generators/dry_scaffold/prototypes/helpers/tests/shoulda/unit_test.rb +9 -0
- data/generators/dry_scaffold/prototypes/helpers/tests/test_unit/unit_test.rb +9 -0
- data/generators/dry_scaffold/prototypes/views/builder/index.atom.builder +20 -0
- data/generators/dry_scaffold/prototypes/views/builder/index.rss.builder +21 -0
- data/generators/dry_scaffold/prototypes/views/haml/_form.html.haml +3 -0
- data/generators/dry_scaffold/prototypes/views/haml/_item.html.haml +9 -0
- data/generators/dry_scaffold/prototypes/views/haml/edit.html.haml +10 -0
- data/generators/dry_scaffold/prototypes/views/haml/index.html.haml +17 -0
- data/generators/dry_scaffold/prototypes/views/haml/layout.html.haml +18 -0
- data/generators/dry_scaffold/prototypes/views/haml/new.html.haml +10 -0
- data/generators/dry_scaffold/prototypes/views/haml/show.html.haml +13 -0
- data/generators/dry_scaffold/templates/controllers/action_controller.rb +250 -0
- data/generators/dry_scaffold/templates/controllers/inherited_resources_controller.rb +26 -0
- data/generators/dry_scaffold/templates/controllers/tests/rspec/functional_test.rb +85 -0
- data/generators/dry_scaffold/templates/controllers/tests/shoulda/functional_test.rb +90 -0
- data/generators/dry_scaffold/templates/controllers/tests/test_unit/functional_test.rb +87 -0
- data/generators/dry_scaffold/templates/helpers/helper.rb +3 -0
- data/generators/dry_scaffold/templates/helpers/tests/rspec/unit_test.rb +9 -0
- data/generators/dry_scaffold/templates/helpers/tests/shoulda/unit_test.rb +9 -0
- data/generators/dry_scaffold/templates/helpers/tests/test_unit/unit_test.rb +9 -0
- data/generators/dry_scaffold/templates/views/builder/index.atom.builder +20 -0
- data/generators/dry_scaffold/templates/views/builder/index.rss.builder +21 -0
- data/generators/dry_scaffold/templates/views/haml/_form.html.haml +13 -0
- data/generators/dry_scaffold/templates/views/haml/_item.html.haml +10 -0
- data/generators/dry_scaffold/templates/views/haml/edit.html.haml +18 -0
- data/generators/dry_scaffold/templates/views/haml/index.html.haml +20 -0
- data/generators/dry_scaffold/templates/views/haml/layout.html.haml +19 -0
- data/generators/dry_scaffold/templates/views/haml/new.html.haml +18 -0
- data/generators/dry_scaffold/templates/views/haml/show.html.haml +13 -0
- data/generators/dscaffold/dscaffold_generator.rb +15 -0
- data/lib/dry_generator.rb +197 -0
- data/lib/dry_scaffold/tasks.rb +5 -0
- data/lib/setup_helper.rb +36 -0
- data/tasks/dry_scaffold.rake +95 -0
- metadata +140 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
class DucksController < ApplicationController
|
|
2
|
+
|
|
3
|
+
before_filter :load_resource, :only => [:show, :edit, :update, :destroy]
|
|
4
|
+
before_filter :load_and_paginate_resource, :only => [:index]
|
|
5
|
+
|
|
6
|
+
# GET /ducks
|
|
7
|
+
# GET /ducks.xml
|
|
8
|
+
# GET /ducks.json
|
|
9
|
+
def index
|
|
10
|
+
respond_to do |format|
|
|
11
|
+
format.html # index.html.haml
|
|
12
|
+
#format.js # index.js.rjs
|
|
13
|
+
format.xml { render :xml => @ducks }
|
|
14
|
+
format.json { render :json => @ducks }
|
|
15
|
+
format.atom # index.atom.builder
|
|
16
|
+
format.rss # index.rss.builder
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# GET /ducks/:id
|
|
21
|
+
# GET /ducks/:id.xml
|
|
22
|
+
# GET /ducks/:id.json
|
|
23
|
+
def show
|
|
24
|
+
respond_to do |format|
|
|
25
|
+
format.html # show.html.haml
|
|
26
|
+
#format.js # show.js.rjs
|
|
27
|
+
format.xml { render :xml => @duck }
|
|
28
|
+
format.json { render :json => @duck }
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# GET /ducks/new
|
|
33
|
+
# GET /ducks/new.xml
|
|
34
|
+
# GET /ducks/new.json
|
|
35
|
+
def new
|
|
36
|
+
@duck = Duck.new
|
|
37
|
+
|
|
38
|
+
respond_to do |format|
|
|
39
|
+
format.html # new.html.haml
|
|
40
|
+
#format.js # new.js.rjs
|
|
41
|
+
format.xml { render :xml => @duck }
|
|
42
|
+
format.json { render :json => @duck }
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# GET /ducks/:id/edit
|
|
47
|
+
def edit
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# POST /ducks
|
|
51
|
+
# POST /ducks.xml
|
|
52
|
+
# POST /ducks.json
|
|
53
|
+
def create
|
|
54
|
+
@duck = Duck.new(params[:duck])
|
|
55
|
+
|
|
56
|
+
respond_to do |format|
|
|
57
|
+
if @duck.save
|
|
58
|
+
flash[:notice] = "Duck was successfully created."
|
|
59
|
+
format.html { redirect_to(@duck) }
|
|
60
|
+
#format.js # create.js.rjs
|
|
61
|
+
format.xml { render :xml => @duck, :status => :created, :location => @duck }
|
|
62
|
+
format.json { render :json => @duck, :status => :created, :location => @duck }
|
|
63
|
+
else
|
|
64
|
+
flash[:error] = "Duck could not be created."
|
|
65
|
+
format.html { render 'new' }
|
|
66
|
+
#format.js # create.js.rjs
|
|
67
|
+
format.xml { render :xml => @duck.errors, :status => :unprocessable_entity }
|
|
68
|
+
format.json { render :json => @duck.errors, :status => :unprocessable_entity }
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# PUT /ducks/:id
|
|
74
|
+
# PUT /ducks/:id.xml
|
|
75
|
+
# PUT /ducks/:id.json
|
|
76
|
+
def update
|
|
77
|
+
respond_to do |format|
|
|
78
|
+
if @duck.update_attributes(params[:duck])
|
|
79
|
+
flash[:notice] = "Duck was successfully updated."
|
|
80
|
+
format.html { redirect_to(@duck) }
|
|
81
|
+
#format.js # update.js.rjs
|
|
82
|
+
format.xml { head :ok }
|
|
83
|
+
format.json { head :ok }
|
|
84
|
+
else
|
|
85
|
+
flash[:error] = "Duck could not be updated."
|
|
86
|
+
format.html { render 'edit' }
|
|
87
|
+
#format.js # update.js.rjs
|
|
88
|
+
format.xml { render :xml => @duck.errors, :status => :unprocessable_entity }
|
|
89
|
+
format.json { render :json => @duck.errors, :status => :unprocessable_entity }
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# DELETE /ducks/:id
|
|
95
|
+
# DELETE /ducks/:id.xml
|
|
96
|
+
# DELETE /ducks/:id.json
|
|
97
|
+
def destroy
|
|
98
|
+
respond_to do |format|
|
|
99
|
+
if @duck.destroy
|
|
100
|
+
flash[:notice] = "Duck was successfully destroyed."
|
|
101
|
+
format.html { redirect_to(ducks_url) }
|
|
102
|
+
#format.js # destroy.js.rjs
|
|
103
|
+
format.xml { head :ok }
|
|
104
|
+
format.json { head :ok }
|
|
105
|
+
else
|
|
106
|
+
flash[:error] = "Duck could not be destroyed."
|
|
107
|
+
format.html { redirect_to(duck_url(@duck)) }
|
|
108
|
+
#format.js # destroy.js.rjs
|
|
109
|
+
format.xml { head :unprocessable_entity }
|
|
110
|
+
format.json { head :unprocessable_entity }
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# GET /ducks/custom_action
|
|
116
|
+
def custom_action
|
|
117
|
+
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
protected
|
|
121
|
+
|
|
122
|
+
def collection
|
|
123
|
+
paginate_options ||= {}
|
|
124
|
+
paginate_options[:page] ||= (params[:page] || 1)
|
|
125
|
+
paginate_options[:per_page] ||= (params[:per_page] || 20)
|
|
126
|
+
@collection = @ducks ||= Duck.paginate(paginate_options)
|
|
127
|
+
end
|
|
128
|
+
alias :load_and_paginate_ducks :collection
|
|
129
|
+
|
|
130
|
+
def resource
|
|
131
|
+
@resource = @duck = ||= Duck.find(params[:id])
|
|
132
|
+
end
|
|
133
|
+
alias :load_resource :resource
|
|
134
|
+
|
|
135
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
class DucksController < InheritedResources::Base
|
|
2
|
+
|
|
3
|
+
actions :index, :show, :new, :create, :edit, :update, :destroy
|
|
4
|
+
respond_to :html, :xml, :json
|
|
5
|
+
respond_to :atom, :rss, :only => [:index]
|
|
6
|
+
|
|
7
|
+
# GET /ducks/custom_action
|
|
8
|
+
def custom_action
|
|
9
|
+
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
protected
|
|
13
|
+
|
|
14
|
+
def collection
|
|
15
|
+
paginate_options ||= {}
|
|
16
|
+
paginate_options[:page] ||= (params[:page] || 1)
|
|
17
|
+
paginate_options[:per_page] ||= (params[:per_page] || 20)
|
|
18
|
+
@collection = @ducks ||= end_of_association_chain.paginate(paginate_options)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def resource
|
|
22
|
+
@resource = @duck ||= end_of_association_chain.find(params[:id])
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
end
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
require File.dirname(__FILE__) + '/../spec_helper'
|
|
2
|
+
|
|
3
|
+
describe DucksController do
|
|
4
|
+
fixtures :all
|
|
5
|
+
integrate_views
|
|
6
|
+
|
|
7
|
+
it "index action should render index template" do
|
|
8
|
+
get :index
|
|
9
|
+
response.should render_template(:index)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
it "show action should render show template" do
|
|
13
|
+
get :show, :id => Duck.first
|
|
14
|
+
response.should render_template(:show)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
it "new action should render new template" do
|
|
18
|
+
get :new
|
|
19
|
+
response.should render_template(:new)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
it "create action should render new template when model is invalid" do
|
|
23
|
+
Duck.any_instance.stubs(:valid?).returns(false)
|
|
24
|
+
post :create
|
|
25
|
+
response.should render_template(:new)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
it "create action should redirect when model is valid" do
|
|
29
|
+
Duck.any_instance.stubs(:valid?).returns(true)
|
|
30
|
+
post :create
|
|
31
|
+
response.should redirect_to(duck_url(assigns[:duck]))
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
it "edit action should render edit template" do
|
|
35
|
+
get :edit, :id => Duck.first
|
|
36
|
+
response.should render_template(:edit)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
it "update action should render edit template when model is invalid" do
|
|
40
|
+
Duck.any_instance.stubs(:valid?).returns(false)
|
|
41
|
+
put :update, :id => Duck.first
|
|
42
|
+
response.should render_template(:edit)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
it "update action should redirect when model is valid" do
|
|
46
|
+
Duck.any_instance.stubs(:valid?).returns(true)
|
|
47
|
+
put :update, :id => Duck.first
|
|
48
|
+
response.should redirect_to(duck_url(assigns[:duck]))
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
it "destroy action should destroy model and redirect to index action" do
|
|
52
|
+
duck = Duck.first
|
|
53
|
+
delete :destroy, :id => duck
|
|
54
|
+
response.should redirect_to(ducks_url)
|
|
55
|
+
Duck.exists?(duck.id).should be_false
|
|
56
|
+
end
|
|
57
|
+
end
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
require 'test_helper'
|
|
2
|
+
|
|
3
|
+
class DucksControllerTest < ActionController::TestCase
|
|
4
|
+
|
|
5
|
+
context 'create' do
|
|
6
|
+
context 'with success' do
|
|
7
|
+
setup do
|
|
8
|
+
Duck.any_instance.expects(:save).returns(true)
|
|
9
|
+
@duck = Factory(:duck)
|
|
10
|
+
post :create, :duck => @duck.attributes
|
|
11
|
+
@duck = Resource.find(:all).last
|
|
12
|
+
end
|
|
13
|
+
should_assign_to flash[:notice]
|
|
14
|
+
should_redirect_to 'duck_path(@duck)'
|
|
15
|
+
end
|
|
16
|
+
context 'with failure' do
|
|
17
|
+
setup do
|
|
18
|
+
Duck.any_instance.expects(:save).returns(false)
|
|
19
|
+
@duck = Factory(:duck)
|
|
20
|
+
post :create, :duck => @duck.attributes
|
|
21
|
+
@duck = Resource.find(:all).last
|
|
22
|
+
end
|
|
23
|
+
should_assign_to flash[:error]
|
|
24
|
+
should_render_template :new
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
context 'update' do
|
|
29
|
+
context 'with success' do
|
|
30
|
+
setup do
|
|
31
|
+
Duck.any_instance.expects(:save).returns(true)
|
|
32
|
+
@duck = Factory(:duck)
|
|
33
|
+
put :update, :id => @duck.to_param, :duck => @duck.attributes
|
|
34
|
+
end
|
|
35
|
+
should_assign_to flash[:notice]
|
|
36
|
+
should_redirect_to 'duck_path(@duck)'
|
|
37
|
+
end
|
|
38
|
+
context 'with failure' do
|
|
39
|
+
setup do
|
|
40
|
+
Duck.any_instance.expects(:save).returns(false)
|
|
41
|
+
@duck = Factory(:duck)
|
|
42
|
+
put :update, :id => @duck.to_param, :duck => @duck.attributes
|
|
43
|
+
end
|
|
44
|
+
should_assign_to flash[:error]
|
|
45
|
+
should_render_template :edit
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
context 'destroy' do
|
|
50
|
+
context 'with success' do
|
|
51
|
+
setup do
|
|
52
|
+
Duck.any_instance.expects(:destroy).returns(true)
|
|
53
|
+
@duck = Factory(:duck)
|
|
54
|
+
delete :destroy, :id => @duck.to_param
|
|
55
|
+
end
|
|
56
|
+
should_assign_to flash[:notice]
|
|
57
|
+
should_redirect_to 'ducks_path'
|
|
58
|
+
end
|
|
59
|
+
# Not possible: destroy with failure
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
context 'new' do
|
|
63
|
+
setup do
|
|
64
|
+
get :new
|
|
65
|
+
end
|
|
66
|
+
should_respond_with :success
|
|
67
|
+
should_render_template :new
|
|
68
|
+
should_assign_to :duck
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
context 'edit' do
|
|
72
|
+
setup do
|
|
73
|
+
@duck = Factory(:duck)
|
|
74
|
+
get :edit, :id => @duck.to_param
|
|
75
|
+
end
|
|
76
|
+
should_respond_with :success
|
|
77
|
+
should_render_template :edit
|
|
78
|
+
should_assign_to :duck
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
context 'show' do
|
|
82
|
+
setup do
|
|
83
|
+
@duck = Factory(:duck)
|
|
84
|
+
get :show, :id => @duck.to_param
|
|
85
|
+
end
|
|
86
|
+
should_respond_with :success
|
|
87
|
+
should_render_template :show
|
|
88
|
+
should_assign_to :duck
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
context 'index' do
|
|
92
|
+
setup do
|
|
93
|
+
get :index
|
|
94
|
+
end
|
|
95
|
+
should_respond_with :success
|
|
96
|
+
should_assign_to :ducks
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
end
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
require 'test_helper'
|
|
2
|
+
|
|
3
|
+
class DucksControllerTest < ActionController::TestCase
|
|
4
|
+
|
|
5
|
+
test 'create' do
|
|
6
|
+
Duck.any_instance.expects(:save).returns(true)
|
|
7
|
+
@duck = ducks(:basic)
|
|
8
|
+
post :create, :duck => @duck.attributes
|
|
9
|
+
assert_not_nil flash[:notice]
|
|
10
|
+
assert_response :redirect
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
test 'create with failure' do
|
|
14
|
+
Duck.any_instance.expects(:save).returns(false)
|
|
15
|
+
@duck = ducks(:basic)
|
|
16
|
+
post :create, :duck => @duck.attributes
|
|
17
|
+
assert_not_nil flash[:error]
|
|
18
|
+
assert_template 'new'
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
test 'update' do
|
|
22
|
+
Duck.any_instance.expects(:save).returns(true)
|
|
23
|
+
@duck = ducks(:basic)
|
|
24
|
+
put :update, :id => @duck.to_param, :duck => @duck.attributes
|
|
25
|
+
assert_not_nil flash[:notice]
|
|
26
|
+
assert_response :redirect
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
test 'update with failure' do
|
|
30
|
+
Duck.any_instance.expects(:save).returns(false)
|
|
31
|
+
@duck = ducks(:basic)
|
|
32
|
+
put :update, :id => @duck.to_param, :duck => @duck.attributes
|
|
33
|
+
assert_not_nil flash[:error]
|
|
34
|
+
assert_template 'edit'
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
test 'destroy' do
|
|
38
|
+
Duck.any_instance.expects(:destroy).returns(true)
|
|
39
|
+
@duck = ducks(:basic)
|
|
40
|
+
delete :destroy, :id => @duck.to_param
|
|
41
|
+
assert_not_nil flash[:notice]
|
|
42
|
+
assert_response :redirect
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Not possible: destroy with failure
|
|
46
|
+
|
|
47
|
+
test 'new' do
|
|
48
|
+
get :new
|
|
49
|
+
assert_response :success
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
test 'edit' do
|
|
53
|
+
@duck = ducks(:basic)
|
|
54
|
+
get :edit, :id => @duck.to_param
|
|
55
|
+
assert_response :success
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
test 'show' do
|
|
59
|
+
@duck = ducks(:basic)
|
|
60
|
+
get :show, :id => @duck.to_param
|
|
61
|
+
assert_response :success
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
test 'index' do
|
|
65
|
+
get :index
|
|
66
|
+
assert_response :success
|
|
67
|
+
assert_not_nil assigns(:ducks)
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
atom_feed(:language => I18n.locale) do |feed|
|
|
2
|
+
feed.title 'Ducks'
|
|
3
|
+
feed.subtitle 'Index of all ducks.'
|
|
4
|
+
# Optional: feed.link :href => ducks_url(:atom), :rel => 'self'
|
|
5
|
+
feed.updated (@ducks.first.created_at rescue Time.now.utc).strftime('%Y-%m-%dT%H:%M:%SZ'))
|
|
6
|
+
|
|
7
|
+
@ducks.each do |duck|
|
|
8
|
+
feed.entry(duck) do |entry|
|
|
9
|
+
entry.title 'title'
|
|
10
|
+
entry.summary 'summary'
|
|
11
|
+
# Optional: entry.content 'content', :type => 'html'
|
|
12
|
+
# Optional: entry.updated duck.try(:updated_at).strftime('%Y-%m-%dT%H:%M:%SZ')
|
|
13
|
+
# Optional: entry.link :href => duck_url(duck, :atom)
|
|
14
|
+
|
|
15
|
+
duck.author do |author|
|
|
16
|
+
author.name 'author_name'
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|