fetty-generators 1.7.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -0
- data/README.rdoc +42 -36
- data/Rakefile +1 -3
- data/lib/generators/fetty.rb +160 -10
- data/lib/generators/fetty/authentication/USAGE +4 -0
- data/lib/generators/fetty/authentication/authentication_generator.rb +171 -0
- data/lib/generators/fetty/authentication/templates/controllers/reset_passwords_controller.rb +45 -0
- data/lib/generators/fetty/authentication/templates/controllers/sessions_controller.rb +30 -0
- data/lib/generators/fetty/authentication/templates/controllers/users_controller.rb +78 -0
- data/lib/generators/fetty/authentication/templates/helpers/reset_passwords_helper.rb +2 -0
- data/lib/generators/fetty/authentication/templates/helpers/sessions_helper.rb +2 -0
- data/lib/generators/fetty/authentication/templates/helpers/users_helper.rb +2 -0
- data/lib/generators/fetty/authentication/templates/lib/sessions_authentication.rb +53 -0
- data/lib/generators/fetty/authentication/templates/lib/users_authentication.rb +110 -0
- data/lib/generators/fetty/authentication/templates/mailers/setup_mail.rb +11 -0
- data/lib/generators/fetty/authentication/templates/mailers/user_mailer.rb +14 -0
- data/lib/generators/fetty/authentication/templates/models/active_record/create_users.rb +17 -0
- data/lib/generators/fetty/authentication/templates/models/active_record/user.rb +15 -0
- data/lib/generators/fetty/authentication/templates/models/mongoid/user.rb +23 -0
- data/lib/generators/fetty/authentication/templates/spec/controllers/reset_passwords_controller_spec.rb +93 -0
- data/lib/generators/fetty/authentication/templates/spec/controllers/sessions_controller_spec.rb +61 -0
- data/lib/generators/fetty/authentication/templates/spec/controllers/users_controller_spec.rb +158 -0
- data/lib/generators/fetty/authentication/templates/spec/models/user_spec.rb +108 -0
- data/lib/generators/fetty/authentication/templates/spec/routing/reset_passwords_routing_spec.rb +21 -0
- data/lib/generators/fetty/authentication/templates/spec/routing/sessions_routing_spec.rb +17 -0
- data/lib/generators/fetty/authentication/templates/spec/routing/users_routing_spec.rb +37 -0
- data/lib/generators/fetty/authentication/templates/spec/support/user_factories.rb +6 -0
- data/lib/generators/fetty/authentication/templates/views/layouts/application.html.erb +33 -0
- data/lib/generators/fetty/authentication/templates/views/reset_passwords/edit.html.erb +19 -0
- data/lib/generators/fetty/authentication/templates/views/reset_passwords/new.html.erb +14 -0
- data/lib/generators/fetty/authentication/templates/views/sessions/new.html.erb +22 -0
- data/lib/generators/fetty/authentication/templates/views/user_mailer/user_activation.text.erb +4 -0
- data/lib/generators/fetty/authentication/templates/views/user_mailer/user_forgot_password.text.erb +7 -0
- data/lib/generators/fetty/authentication/templates/views/users/_table.html.erb +23 -0
- data/lib/generators/fetty/authentication/templates/views/users/edit.html.erb +21 -0
- data/lib/generators/fetty/authentication/templates/views/users/index.html.erb +7 -0
- data/lib/generators/fetty/authentication/templates/views/users/index.js.erb +1 -0
- data/lib/generators/fetty/authentication/templates/views/users/new.html.erb +23 -0
- data/lib/generators/fetty/authentication/templates/views/users/show.html.erb +19 -0
- data/lib/generators/fetty/messages/USAGE +4 -0
- data/lib/generators/fetty/messages/messages_generator.rb +136 -0
- data/lib/generators/fetty/messages/templates/assets/javascripts/jquery.tokeninput.js +718 -0
- data/lib/generators/fetty/messages/templates/assets/javascripts/messages.js +19 -0
- data/lib/generators/fetty/messages/templates/assets/stylesheets/messages.css +87 -0
- data/lib/generators/fetty/messages/templates/assets/stylesheets/token-input-facebook.css +122 -0
- data/lib/generators/fetty/messages/templates/controllers/messages_controller.rb +109 -0
- data/lib/generators/fetty/messages/templates/helpers/messages_helper.rb +2 -0
- data/lib/generators/fetty/messages/templates/lib/users_messages.rb +67 -0
- data/lib/generators/fetty/messages/templates/models/active_record/create_messages.rb +24 -0
- data/lib/generators/fetty/messages/templates/models/active_record/message.rb +67 -0
- data/lib/generators/fetty/messages/templates/models/mongoid/message.rb +81 -0
- data/lib/generators/fetty/messages/templates/spec/controllers/messages_controller_spec.rb +78 -0
- data/lib/generators/fetty/messages/templates/spec/models/message_spec.rb +53 -0
- data/lib/generators/fetty/messages/templates/spec/routing/messages_routing_spec.rb +61 -0
- data/lib/generators/fetty/messages/templates/spec/support/message_factories.rb +8 -0
- data/lib/generators/fetty/messages/templates/views/_head.html.erb +20 -0
- data/lib/generators/fetty/messages/templates/views/_messages.html.erb +56 -0
- data/lib/generators/fetty/messages/templates/views/_tabs_panel.html.erb +11 -0
- data/lib/generators/fetty/messages/templates/views/index.html.erb +10 -0
- data/lib/generators/fetty/messages/templates/views/index.js.erb +1 -0
- data/lib/generators/fetty/messages/templates/views/new.html.erb +26 -0
- data/lib/generators/fetty/messages/templates/views/show.html.erb +35 -0
- data/lib/generators/fetty/scaffold/USAGE +2 -52
- data/lib/generators/fetty/scaffold/scaffold_generator.rb +96 -329
- data/lib/generators/fetty/scaffold/templates/controllers/active_record/controller.rb +60 -0
- data/lib/generators/fetty/scaffold/templates/controllers/mongoid/controller.rb +60 -0
- data/lib/generators/fetty/scaffold/templates/helpers/helper.rb +2 -0
- data/lib/generators/fetty/scaffold/templates/models/active_record/migration.rb +16 -0
- data/lib/generators/fetty/scaffold/templates/models/active_record/model.rb +10 -0
- data/lib/generators/fetty/scaffold/templates/models/mongoid/model.rb +16 -0
- data/lib/generators/fetty/scaffold/templates/test/rspec/controller.rb +98 -0
- data/lib/generators/fetty/scaffold/templates/test/rspec/factories.rb +26 -0
- data/lib/generators/fetty/scaffold/templates/test/rspec/helper.rb +15 -0
- data/lib/generators/fetty/scaffold/templates/test/rspec/model.rb +9 -0
- data/lib/generators/fetty/scaffold/templates/test/rspec/request.rb +11 -0
- data/lib/generators/fetty/scaffold/templates/test/rspec/routing.rb +41 -0
- data/lib/generators/fetty/scaffold/templates/test/test_unit/controller.rb +62 -0
- data/lib/generators/fetty/scaffold/templates/{fixtures.yml → test/test_unit/fixtures.yml} +2 -0
- data/lib/generators/fetty/scaffold/templates/test/test_unit/helper.rb +4 -0
- data/lib/generators/fetty/scaffold/templates/test/test_unit/model.rb +7 -0
- data/lib/generators/fetty/scaffold/templates/views/_form.html.erb +20 -0
- data/lib/generators/fetty/scaffold/templates/views/_table.html.erb +48 -0
- data/lib/generators/fetty/scaffold/templates/views/edit.html.erb +13 -0
- data/lib/generators/fetty/scaffold/templates/views/index.html.erb +15 -0
- data/lib/generators/fetty/scaffold/templates/views/{erb/index.js.erb → index.js.erb} +0 -0
- data/lib/generators/fetty/scaffold/templates/views/new.html.erb +9 -0
- data/lib/generators/fetty/scaffold/templates/views/show.html.erb +28 -0
- data/lib/generators/fetty/setup/USAGE +3 -20
- data/lib/generators/fetty/setup/setup_generator.rb +122 -61
- data/lib/generators/fetty/setup/templates/ability.rb +0 -0
- data/lib/generators/fetty/setup/templates/ckeditor.rb +54 -0
- data/lib/generators/fetty/setup/templates/ckeditor.tar.gz +0 -0
- data/lib/generators/fetty/setup/templates/escape_utils.rb +7 -0
- data/lib/generators/fetty/setup/templates/file_uploader.rb +15 -0
- data/lib/generators/fetty/setup/templates/image_uploader.rb +48 -0
- data/lib/generators/fetty/setup/templates/spec_helper.rb +44 -0
- data/lib/generators/fetty/views/USAGE +5 -0
- data/lib/generators/fetty/{layout/templates/stylesheet.css → views/templates/application.css} +184 -166
- data/lib/generators/fetty/views/templates/application.html.erb +23 -0
- data/lib/generators/fetty/{layout → views}/templates/application.js +0 -0
- data/lib/generators/fetty/views/templates/application_helper.rb +10 -0
- data/lib/generators/fetty/views/templates/down_arrow.gif +0 -0
- data/lib/generators/fetty/{layout → views}/templates/error_messages_helper.rb +0 -0
- data/lib/generators/fetty/{layout → views}/templates/layout_helper.rb +0 -0
- data/lib/generators/fetty/views/templates/up_arrow.gif +0 -0
- data/lib/generators/fetty/views/views_generator.rb +51 -0
- data/lib/generators/scaffold.rb +204 -0
- metadata +126 -111
- data/LICENSE +0 -20
- data/lib/generators/fetty/layout/USAGE +0 -26
- data/lib/generators/fetty/layout/layout_generator.rb +0 -44
- data/lib/generators/fetty/layout/templates/layout.html.erb +0 -32
- data/lib/generators/fetty/layout/templates/layout.html.haml +0 -34
- data/lib/generators/fetty/layout/templates/no-devise-links-layout.html.erb +0 -23
- data/lib/generators/fetty/layout/templates/no-devise-links-layout.html.haml +0 -23
- data/lib/generators/fetty/layout/templates/stylesheet.sass +0 -163
- data/lib/generators/fetty/scaffold/templates/actions/create.rb +0 -8
- data/lib/generators/fetty/scaffold/templates/actions/destroy.rb +0 -5
- data/lib/generators/fetty/scaffold/templates/actions/edit.rb +0 -3
- data/lib/generators/fetty/scaffold/templates/actions/index.rb +0 -10
- data/lib/generators/fetty/scaffold/templates/actions/new.rb +0 -3
- data/lib/generators/fetty/scaffold/templates/actions/show.rb +0 -3
- data/lib/generators/fetty/scaffold/templates/actions/update.rb +0 -8
- data/lib/generators/fetty/scaffold/templates/controller.rb +0 -7
- data/lib/generators/fetty/scaffold/templates/helper.rb +0 -2
- data/lib/generators/fetty/scaffold/templates/migration.rb +0 -16
- data/lib/generators/fetty/scaffold/templates/model.rb +0 -7
- data/lib/generators/fetty/scaffold/templates/tests/rspec/actions/create.rb +0 -11
- data/lib/generators/fetty/scaffold/templates/tests/rspec/actions/destroy.rb +0 -6
- data/lib/generators/fetty/scaffold/templates/tests/rspec/actions/edit.rb +0 -4
- data/lib/generators/fetty/scaffold/templates/tests/rspec/actions/index.rb +0 -4
- data/lib/generators/fetty/scaffold/templates/tests/rspec/actions/new.rb +0 -4
- data/lib/generators/fetty/scaffold/templates/tests/rspec/actions/show.rb +0 -4
- data/lib/generators/fetty/scaffold/templates/tests/rspec/actions/update.rb +0 -11
- data/lib/generators/fetty/scaffold/templates/tests/rspec/controller.rb +0 -8
- data/lib/generators/fetty/scaffold/templates/tests/rspec/model.rb +0 -7
- data/lib/generators/fetty/scaffold/templates/tests/shoulda/actions/create.rb +0 -13
- data/lib/generators/fetty/scaffold/templates/tests/shoulda/actions/destroy.rb +0 -8
- data/lib/generators/fetty/scaffold/templates/tests/shoulda/actions/edit.rb +0 -6
- data/lib/generators/fetty/scaffold/templates/tests/shoulda/actions/index.rb +0 -6
- data/lib/generators/fetty/scaffold/templates/tests/shoulda/actions/new.rb +0 -6
- data/lib/generators/fetty/scaffold/templates/tests/shoulda/actions/show.rb +0 -6
- data/lib/generators/fetty/scaffold/templates/tests/shoulda/actions/update.rb +0 -13
- data/lib/generators/fetty/scaffold/templates/tests/shoulda/controller.rb +0 -5
- data/lib/generators/fetty/scaffold/templates/tests/shoulda/model.rb +0 -7
- data/lib/generators/fetty/scaffold/templates/tests/testunit/actions/create.rb +0 -11
- data/lib/generators/fetty/scaffold/templates/tests/testunit/actions/destroy.rb +0 -6
- data/lib/generators/fetty/scaffold/templates/tests/testunit/actions/edit.rb +0 -4
- data/lib/generators/fetty/scaffold/templates/tests/testunit/actions/index.rb +0 -4
- data/lib/generators/fetty/scaffold/templates/tests/testunit/actions/new.rb +0 -4
- data/lib/generators/fetty/scaffold/templates/tests/testunit/actions/show.rb +0 -4
- data/lib/generators/fetty/scaffold/templates/tests/testunit/actions/update.rb +0 -11
- data/lib/generators/fetty/scaffold/templates/tests/testunit/controller.rb +0 -5
- data/lib/generators/fetty/scaffold/templates/tests/testunit/model.rb +0 -7
- data/lib/generators/fetty/scaffold/templates/views/erb/_form.html.erb +0 -22
- data/lib/generators/fetty/scaffold/templates/views/erb/_table.html.erb +0 -50
- data/lib/generators/fetty/scaffold/templates/views/erb/edit.html.erb +0 -12
- data/lib/generators/fetty/scaffold/templates/views/erb/index.html.erb +0 -13
- data/lib/generators/fetty/scaffold/templates/views/erb/new.html.erb +0 -9
- data/lib/generators/fetty/scaffold/templates/views/erb/show.html.erb +0 -26
- data/lib/generators/fetty/scaffold/templates/views/haml/_form.html.haml +0 -8
- data/lib/generators/fetty/scaffold/templates/views/haml/_table.html.haml +0 -33
- data/lib/generators/fetty/scaffold/templates/views/haml/edit.html.haml +0 -14
- data/lib/generators/fetty/scaffold/templates/views/haml/index.html.haml +0 -12
- data/lib/generators/fetty/scaffold/templates/views/haml/index.js.haml +0 -1
- data/lib/generators/fetty/scaffold/templates/views/haml/new.html.haml +0 -8
- data/lib/generators/fetty/scaffold/templates/views/haml/show.html.haml +0 -23
@@ -1,16 +0,0 @@
|
|
1
|
-
class Create<%= class_name.pluralize.delete('::') %> < ActiveRecord::Migration
|
2
|
-
def self.up
|
3
|
-
create_table :<%= table_name || plural_name.split('/').last %> do |t|
|
4
|
-
<%- for attribute in model_attributes -%>
|
5
|
-
t.<%= attribute.type %> :<%= attribute.name %>
|
6
|
-
<%- end -%>
|
7
|
-
<%- unless options[:skip_timestamps] -%>
|
8
|
-
t.timestamps
|
9
|
-
<%- end -%>
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
def self.down
|
14
|
-
drop_table :<%= table_name || plural_name.split('/').last %>
|
15
|
-
end
|
16
|
-
end
|
@@ -1,7 +0,0 @@
|
|
1
|
-
class <%= class_name %> < ActiveRecord::Base
|
2
|
-
<%= "set_table_name :#{table_name}\n" if table_name -%>
|
3
|
-
<%- unless @paperclip_name.empty? -%>
|
4
|
-
has_attached_file <%= @paperclip_name.map { |name| ":#{name}" }.join(", ") %>
|
5
|
-
<%- end -%>
|
6
|
-
attr_accessible <%= model_attributes.map { |a| ":#{a.name}" }.join(", ") %>
|
7
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
it "create action should render new template when model is invalid" do
|
2
|
-
<%= class_name %>.any_instance.stubs(:valid?).returns(false)
|
3
|
-
post :create
|
4
|
-
response.should render_template(:new)
|
5
|
-
end
|
6
|
-
|
7
|
-
it "create action should redirect when model is valid" do
|
8
|
-
<%= class_name %>.any_instance.stubs(:valid?).returns(true)
|
9
|
-
post :create
|
10
|
-
response.should redirect_to(<%= item_path_for_spec('url') %>)
|
11
|
-
end
|
@@ -1,6 +0,0 @@
|
|
1
|
-
it "destroy action should destroy model and redirect to index action" do
|
2
|
-
<%= instance_name %> = <%= class_name %>.first
|
3
|
-
delete :destroy, :id => <%= instance_name %>
|
4
|
-
response.should redirect_to(<%= items_url %>)
|
5
|
-
<%= class_name %>.exists?(<%= instance_name %>.id).should be_false
|
6
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
it "update action should render edit template when model is invalid" do
|
2
|
-
<%= class_name %>.any_instance.stubs(:valid?).returns(false)
|
3
|
-
put :update, :id => <%= class_name %>.first
|
4
|
-
response.should render_template(:edit)
|
5
|
-
end
|
6
|
-
|
7
|
-
it "update action should redirect when model is valid" do
|
8
|
-
<%= class_name %>.any_instance.stubs(:valid?).returns(true)
|
9
|
-
put :update, :id => <%= class_name %>.first
|
10
|
-
response.should redirect_to(<%= item_path_for_spec('url') %>)
|
11
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
context "create action" do
|
2
|
-
should "render new template when model is invalid" do
|
3
|
-
<%= class_name %>.any_instance.stubs(:valid?).returns(false)
|
4
|
-
post :create
|
5
|
-
assert_template 'new'
|
6
|
-
end
|
7
|
-
|
8
|
-
should "redirect when model is valid" do
|
9
|
-
<%= class_name %>.any_instance.stubs(:valid?).returns(true)
|
10
|
-
post :create
|
11
|
-
assert_redirected_to <%= item_path_for_test('url') %>
|
12
|
-
end
|
13
|
-
end
|
@@ -1,8 +0,0 @@
|
|
1
|
-
context "destroy action" do
|
2
|
-
should "destroy model and redirect to index action" do
|
3
|
-
<%= instance_name %> = <%= class_name %>.first
|
4
|
-
delete :destroy, :id => <%= instance_name %>
|
5
|
-
assert_redirected_to <%= items_url %>
|
6
|
-
assert !<%= class_name %>.exists?(<%= instance_name %>.id)
|
7
|
-
end
|
8
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
context "update action" do
|
2
|
-
should "render edit template when model is invalid" do
|
3
|
-
<%= class_name %>.any_instance.stubs(:valid?).returns(false)
|
4
|
-
put :update, :id => <%= class_name %>.first
|
5
|
-
assert_template 'edit'
|
6
|
-
end
|
7
|
-
|
8
|
-
should "redirect when model is valid" do
|
9
|
-
<%= class_name %>.any_instance.stubs(:valid?).returns(true)
|
10
|
-
put :update, :id => <%= class_name %>.first
|
11
|
-
assert_redirected_to <%= item_path_for_test('url') %>
|
12
|
-
end
|
13
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
def test_create_invalid
|
2
|
-
<%= class_name %>.any_instance.stubs(:valid?).returns(false)
|
3
|
-
post :create
|
4
|
-
assert_template 'new'
|
5
|
-
end
|
6
|
-
|
7
|
-
def test_create_valid
|
8
|
-
<%= class_name %>.any_instance.stubs(:valid?).returns(true)
|
9
|
-
post :create
|
10
|
-
assert_redirected_to <%= item_path_for_test('url') %>
|
11
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
def test_update_invalid
|
2
|
-
<%= class_name %>.any_instance.stubs(:valid?).returns(false)
|
3
|
-
put :update, :id => <%= class_name %>.first
|
4
|
-
assert_template 'edit'
|
5
|
-
end
|
6
|
-
|
7
|
-
def test_update_valid
|
8
|
-
<%= class_name %>.any_instance.stubs(:valid?).returns(true)
|
9
|
-
put :update, :id => <%= class_name %>.first
|
10
|
-
assert_redirected_to <%= item_path_for_test('url') %>
|
11
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
<%- unless @tinymce_name.empty? -%>
|
2
|
-
<%% content_for(:head) do %>
|
3
|
-
<%%= include_tiny_mce_if_needed %>
|
4
|
-
<%% end %>
|
5
|
-
<%- end -%>
|
6
|
-
<%%= simple_form_for @<%= instance_name %><%= ", :html => { :multipart => true }" unless @paperclip_name.empty? -%> do |f| %>
|
7
|
-
<%%= f.error_messages %>
|
8
|
-
|
9
|
-
<div class="inputs">
|
10
|
-
<%- for attribute in model_attributes -%>
|
11
|
-
<%- unless @tinymce_name.include?(attribute.name) -%>
|
12
|
-
<%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> %>
|
13
|
-
<%- else -%>
|
14
|
-
<%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %>, :input_html => { :class => 'mceEditor' } %>
|
15
|
-
<%- end -%>
|
16
|
-
<%- end -%>
|
17
|
-
</div>
|
18
|
-
|
19
|
-
<div class="actions">
|
20
|
-
<%%= f.button :submit %>
|
21
|
-
</div>
|
22
|
-
<%% end %>
|
@@ -1,50 +0,0 @@
|
|
1
|
-
<table class="pretty">
|
2
|
-
<tr>
|
3
|
-
<%- for attribute in model_attributes -%>
|
4
|
-
<%- unless @paperclip_name.include?(attribute.name) -%>
|
5
|
-
<th><%%= sort_link @search, :<%= attribute.name %> %></th>
|
6
|
-
<%- else -%>
|
7
|
-
<th><%= attribute.name %></th>
|
8
|
-
<%- end -%>
|
9
|
-
<%- end -%>
|
10
|
-
<%- if action? :show -%>
|
11
|
-
<th></th>
|
12
|
-
<%- end -%>
|
13
|
-
<%- if action? :edit -%>
|
14
|
-
<th></th>
|
15
|
-
<%- end -%>
|
16
|
-
<%- if action? :destroy -%>
|
17
|
-
<th></th>
|
18
|
-
<%- end -%>
|
19
|
-
</tr>
|
20
|
-
<%% for <%= instance_name %> in @<%= instances_name %> %>
|
21
|
-
<tr>
|
22
|
-
<%- for attribute in model_attributes -%>
|
23
|
-
<%- if @paperclip_name.include?(attribute.name) -%>
|
24
|
-
<td><%%= image_tag <%= instance_name %>.<%= attribute.name %>.url %></td>
|
25
|
-
<%- elsif @tinymce_name.include?(attribute.name) -%>
|
26
|
-
<td><%%= raw <%= instance_name %>.<%= attribute.name %> %></td>
|
27
|
-
<%- else -%>
|
28
|
-
<td><%%= <%= instance_name %>.<%= attribute.name %> %></td>
|
29
|
-
<%- end -%>
|
30
|
-
<%- end -%>
|
31
|
-
<%- if action? :show -%>
|
32
|
-
<td>
|
33
|
-
<%= generate_action_links(:read, instance_name, "Show", instance_name) %>
|
34
|
-
</td>
|
35
|
-
<%- end -%>
|
36
|
-
<%- if action? :edit -%>
|
37
|
-
<td>
|
38
|
-
<%= generate_action_links(:update, instance_name, "Edit", "edit_#{singular_table_name}_path(#{instance_name})") %>
|
39
|
-
</td>
|
40
|
-
<%- end -%>
|
41
|
-
<%- if action? :destroy -%>
|
42
|
-
<td>
|
43
|
-
<%= generate_action_links(:destroy, instance_name, "Destroy", instance_name) %>
|
44
|
-
</td>
|
45
|
-
<%- end -%>
|
46
|
-
</tr>
|
47
|
-
<%% end %>
|
48
|
-
</table>
|
49
|
-
|
50
|
-
<p><%%= will_paginate @<%= instances_name %> %></p>
|
@@ -1,12 +0,0 @@
|
|
1
|
-
<%% title "Edit <%= singular_name.titleize %>" %>
|
2
|
-
|
3
|
-
<%= render_form %>
|
4
|
-
|
5
|
-
<p>
|
6
|
-
<%- if action? :show -%>
|
7
|
-
<%= generate_action_links(:read, "@#{instance_name}", "Show", "@#{instance_name}") %> |
|
8
|
-
<%- end -%>
|
9
|
-
<%- if action? :index -%>
|
10
|
-
<%= generate_action_links(:index, class_name, "View All", items_path) %>
|
11
|
-
<%- end -%>
|
12
|
-
</p>
|
@@ -1,13 +0,0 @@
|
|
1
|
-
<%% title "<%= plural_name.titleize %>" %>
|
2
|
-
|
3
|
-
<%%= form_for @search, :url => <%= items_path %>, :html => {:id => "index_search", :method => :get} do |f| %>
|
4
|
-
<%%= f.text_field :<%= model_attributes[0].name %>_contains, :title => "Search by <%= model_attributes[0].name %>" %>
|
5
|
-
<%% end %>
|
6
|
-
|
7
|
-
<div id="index_table"><%= render_table %></div>
|
8
|
-
|
9
|
-
<%- if action? :new -%>
|
10
|
-
<p>
|
11
|
-
<%= generate_action_links(:create, class_name, "New #{singular_table_name.titleize}", "new_#{singular_table_name}_path") %>
|
12
|
-
</p>
|
13
|
-
<%- end -%>
|
@@ -1,26 +0,0 @@
|
|
1
|
-
<%% title "<%= singular_name.titleize %>" %>
|
2
|
-
|
3
|
-
<%- for attribute in model_attributes -%>
|
4
|
-
<p>
|
5
|
-
<strong><%= attribute.human_name.titleize %>:</strong>
|
6
|
-
<%- if @paperclip_name.include?(attribute.name) -%>
|
7
|
-
<%%= image_tag @<%= instance_name %>.<%= attribute.name %>.url %>
|
8
|
-
<%- elsif @tinymce_name.include?(attribute.name) -%>
|
9
|
-
<%%= raw @<%= instance_name %>.<%= attribute.name %> %>
|
10
|
-
<%- else -%>
|
11
|
-
<%%= @<%= instance_name %>.<%= attribute.name %> %>
|
12
|
-
<%- end -%>
|
13
|
-
</p>
|
14
|
-
<%- end -%>
|
15
|
-
|
16
|
-
<p>
|
17
|
-
<%- if action? :edit -%>
|
18
|
-
<%= generate_action_links(:update, "@#{instance_name}", "Edit", "edit_#{singular_table_name}_path(@#{instance_name})") %> |
|
19
|
-
<%- end -%>
|
20
|
-
<%- if action? :destroy -%>
|
21
|
-
<%= generate_action_links(:destroy, "@#{instance_name}", "Destroy", "@#{instance_name}") %> |
|
22
|
-
<%- end -%>
|
23
|
-
<%- if action? :index -%>
|
24
|
-
<%= generate_action_links(:index, class_name, "View All", items_path) %>
|
25
|
-
<%- end -%>
|
26
|
-
</p>
|
@@ -1,33 +0,0 @@
|
|
1
|
-
%table{:class => "pretty"}
|
2
|
-
%tr
|
3
|
-
<%- for attribute in model_attributes -%>
|
4
|
-
%th= sort_link @search, :<%= attribute.name %>
|
5
|
-
<%- end -%>
|
6
|
-
<%- if action? :show -%>
|
7
|
-
%th
|
8
|
-
<%- end -%>
|
9
|
-
<%- if action? :edit -%>
|
10
|
-
%th
|
11
|
-
<%- end -%>
|
12
|
-
<%- if action? :destroy -%>
|
13
|
-
%th
|
14
|
-
<%- end -%>
|
15
|
-
- for <%= instance_name %> in @<%= instances_name %>
|
16
|
-
%tr
|
17
|
-
<%- for attribute in model_attributes -%>
|
18
|
-
%td= <%= instance_name %>.<%= attribute.name %>
|
19
|
-
<%- end -%>
|
20
|
-
<%- if action? :show -%>
|
21
|
-
- if can? :read, <%= instance_name %>
|
22
|
-
%td= link_to 'Show', <%= instance_name %>
|
23
|
-
<%- end -%>
|
24
|
-
<%- if action? :edit -%>
|
25
|
-
- if can? :update, <%= instance_name %>
|
26
|
-
%td= link_to 'Edit', <%= item_path :action => :edit %>
|
27
|
-
<%- end -%>
|
28
|
-
<%- if action? :destroy -%>
|
29
|
-
- if can? :destroy, <%= instance_name %>
|
30
|
-
%td= link_to 'Destroy', <%= item_path %>, :confirm => 'Are you sure?', :method => :delete
|
31
|
-
<%- end -%>
|
32
|
-
|
33
|
-
%p= will_paginate @<%= plural_name %>
|