rails 1.1.6 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rails might be problematic. Click here for more details.
- data/CHANGELOG +267 -2
- data/MIT-LICENSE +1 -1
- data/README +62 -63
- data/Rakefile +26 -15
- data/bin/process/inspector +3 -0
- data/configs/databases/frontbase.yml +28 -0
- data/configs/databases/mysql.yml +3 -2
- data/configs/databases/oracle.yml +10 -1
- data/configs/databases/sqlite3.yml +3 -0
- data/configs/lighttpd.conf +1 -0
- data/configs/routes.rb +1 -0
- data/environments/boot.rb +4 -3
- data/environments/environment.rb +9 -2
- data/environments/production.rb +1 -1
- data/helpers/application.rb +5 -2
- data/html/404.html +27 -5
- data/html/500.html +27 -5
- data/html/javascripts/controls.js +41 -23
- data/html/javascripts/dragdrop.js +105 -76
- data/html/javascripts/effects.js +293 -163
- data/html/javascripts/prototype.js +897 -389
- data/lib/breakpoint.rb +31 -1
- data/lib/breakpoint_client.rb +5 -5
- data/lib/code_statistics.rb +1 -1
- data/lib/commands/performance/profiler.rb +25 -9
- data/lib/commands/plugin.rb +69 -23
- data/lib/commands/process/inspector.rb +68 -0
- data/lib/commands/process/reaper.rb +88 -69
- data/lib/commands/process/spawner.rb +148 -33
- data/lib/commands/runner.rb +27 -6
- data/lib/commands/server.rb +18 -9
- data/lib/commands/servers/base.rb +19 -0
- data/lib/commands/servers/lighttpd.rb +20 -18
- data/lib/commands/servers/mongrel.rb +65 -0
- data/lib/console_sandbox.rb +2 -2
- data/lib/dispatcher.rb +67 -11
- data/lib/fcgi_handler.rb +52 -34
- data/lib/initializer.rb +190 -111
- data/lib/rails/version.rb +2 -2
- data/lib/rails_generator/base.rb +82 -24
- data/lib/rails_generator/commands.rb +87 -25
- data/lib/rails_generator/generated_attribute.rb +42 -0
- data/lib/rails_generator/generators/applications/app/app_generator.rb +13 -10
- data/lib/rails_generator/generators/components/controller/controller_generator.rb +1 -2
- data/lib/rails_generator/generators/components/mailer/mailer_generator.rb +10 -8
- data/lib/rails_generator/generators/components/mailer/templates/fixture.rhtml +1 -1
- data/lib/rails_generator/generators/components/mailer/templates/unit_test.rb +4 -4
- data/lib/rails_generator/generators/components/mailer/templates/view.rhtml +1 -1
- data/lib/rails_generator/generators/components/migration/templates/migration.rb +1 -1
- data/lib/rails_generator/generators/components/model/USAGE +19 -12
- data/lib/rails_generator/generators/components/model/model_generator.rb +4 -0
- data/lib/rails_generator/generators/components/model/templates/fixtures.yml +8 -2
- data/lib/rails_generator/generators/components/model/templates/migration.rb +3 -1
- data/lib/rails_generator/generators/components/observer/USAGE +15 -0
- data/lib/rails_generator/generators/components/observer/observer_generator.rb +16 -0
- data/lib/rails_generator/generators/components/observer/templates/observer.rb +2 -0
- data/lib/rails_generator/generators/components/observer/templates/unit_test.rb +10 -0
- data/lib/rails_generator/generators/components/plugin/plugin_generator.rb +4 -0
- data/lib/rails_generator/generators/components/plugin/templates/uninstall.rb +1 -0
- data/lib/rails_generator/generators/components/resource/resource_generator.rb +76 -0
- data/lib/rails_generator/generators/components/resource/templates/USAGE +18 -0
- data/lib/rails_generator/generators/components/resource/templates/controller.rb +2 -0
- data/lib/rails_generator/generators/components/resource/templates/fixtures.yml +11 -0
- data/lib/rails_generator/generators/components/resource/templates/functional_test.rb +20 -0
- data/lib/rails_generator/generators/components/resource/templates/helper.rb +2 -0
- data/lib/rails_generator/generators/components/resource/templates/migration.rb +13 -0
- data/lib/rails_generator/generators/components/resource/templates/model.rb +2 -0
- data/lib/rails_generator/generators/components/resource/templates/unit_test.rb +10 -0
- data/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb +10 -1
- data/lib/rails_generator/generators/components/scaffold/templates/functional_test.rb +11 -7
- data/lib/rails_generator/generators/components/scaffold/templates/layout.rhtml +5 -1
- data/lib/rails_generator/generators/components/scaffold/templates/view_edit.rhtml +2 -2
- data/lib/rails_generator/generators/components/scaffold/templates/view_list.rhtml +1 -1
- data/lib/rails_generator/generators/components/scaffold/templates/view_new.rhtml +2 -2
- data/lib/rails_generator/generators/components/scaffold_resource/USAGE +29 -0
- data/lib/rails_generator/generators/components/scaffold_resource/scaffold_resource_generator.rb +92 -0
- data/lib/rails_generator/generators/components/scaffold_resource/templates/controller.rb +79 -0
- data/lib/rails_generator/generators/components/scaffold_resource/templates/fixtures.yml +11 -0
- data/lib/rails_generator/generators/components/scaffold_resource/templates/functional_test.rb +57 -0
- data/lib/rails_generator/generators/components/scaffold_resource/templates/helper.rb +2 -0
- data/lib/rails_generator/generators/components/scaffold_resource/templates/layout.rhtml +17 -0
- data/lib/rails_generator/generators/components/scaffold_resource/templates/migration.rb +13 -0
- data/lib/rails_generator/generators/components/scaffold_resource/templates/model.rb +2 -0
- data/lib/rails_generator/generators/components/scaffold_resource/templates/style.css +74 -0
- data/lib/rails_generator/generators/components/scaffold_resource/templates/unit_test.rb +10 -0
- data/lib/rails_generator/generators/components/scaffold_resource/templates/view_edit.rhtml +19 -0
- data/lib/rails_generator/generators/components/scaffold_resource/templates/view_index.rhtml +24 -0
- data/lib/rails_generator/generators/components/scaffold_resource/templates/view_new.rhtml +18 -0
- data/lib/rails_generator/generators/components/scaffold_resource/templates/view_show.rhtml +10 -0
- data/lib/rails_generator/generators/components/session_migration/session_migration_generator.rb +7 -1
- data/lib/rails_generator/generators/components/session_migration/templates/migration.rb +5 -4
- data/lib/rails_generator/lookup.rb +1 -2
- data/lib/rails_generator/options.rb +6 -3
- data/lib/tasks/databases.rake +46 -20
- data/lib/tasks/documentation.rake +1 -0
- data/lib/tasks/framework.rake +1 -3
- data/lib/tasks/pre_namespace_aliases.rake +34 -27
- data/lib/tasks/rails.rb +2 -2
- data/lib/tasks/statistics.rake +6 -5
- data/lib/tasks/testing.rake +28 -13
- data/lib/tasks/tmp.rake +8 -1
- data/lib/test_help.rb +3 -2
- data/lib/webrick_server.rb +6 -8
- metadata +50 -9
@@ -1,5 +1,9 @@
|
|
1
|
-
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
2
5
|
<head>
|
6
|
+
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
|
3
7
|
<title><%= controller_class_name %>: <%%= controller.action_name %></title>
|
4
8
|
<%%= stylesheet_link_tag 'scaffold' %>
|
5
9
|
</head>
|
@@ -1,9 +1,9 @@
|
|
1
1
|
<h1>Editing <%= singular_name %></h1>
|
2
2
|
|
3
|
-
|
3
|
+
<%% form_tag :action => 'update<%= @suffix %>', :id => @<%= singular_name %> do %>
|
4
4
|
<%%= render :partial => 'form' %>
|
5
5
|
<%%= submit_tag 'Edit' %>
|
6
|
-
|
6
|
+
<%% end %>
|
7
7
|
|
8
8
|
<%%= link_to 'Show', :action => 'show<%= suffix %>', :id => @<%= singular_name %> %> |
|
9
9
|
<%%= link_to 'Back', :action => 'list<%= suffix %>' %>
|
@@ -14,7 +14,7 @@
|
|
14
14
|
<%% end %>
|
15
15
|
<td><%%= link_to 'Show', :action => 'show<%= suffix %>', :id => <%= singular_name %> %></td>
|
16
16
|
<td><%%= link_to 'Edit', :action => 'edit<%= suffix %>', :id => <%= singular_name %> %></td>
|
17
|
-
<td><%%= link_to 'Destroy', { :action => 'destroy<%= suffix %>', :id => <%= singular_name %> }, :confirm => 'Are you sure?', :
|
17
|
+
<td><%%= link_to 'Destroy', { :action => 'destroy<%= suffix %>', :id => <%= singular_name %> }, :confirm => 'Are you sure?', :method => :post %></td>
|
18
18
|
</tr>
|
19
19
|
<%% end %>
|
20
20
|
</table>
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<h1>New <%= singular_name %></h1>
|
2
2
|
|
3
|
-
|
3
|
+
<%% form_tag :action => 'create<%= @suffix %>' do %>
|
4
4
|
<%%= render :partial => 'form' %>
|
5
5
|
<%%= submit_tag "Create" %>
|
6
|
-
|
6
|
+
<%% end %>
|
7
7
|
|
8
8
|
<%%= link_to 'Back', :action => 'list<%= suffix %>' %>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
Description:
|
2
|
+
The scaffold resource generator creates a model, a controller, and a set of templates that's ready to use as the
|
3
|
+
starting point for your REST-like, resource-oriented application. This basically means that it follows a set of
|
4
|
+
conventions to exploit the full set of HTTP verbs (GET/POST/PUT/DELETE) and is prepared for multi-client access
|
5
|
+
(like one view for HTML, one for an XML API, one for ATOM, etc). Everything comes with sample unit and functional
|
6
|
+
tests as well.
|
7
|
+
|
8
|
+
The generator takes the name of the model as its first argument. This model name is then pluralized to get the
|
9
|
+
controller name. So "scaffold_resource post" will generate a Post model and a PostsController and will be intended
|
10
|
+
for URLs like /posts and /posts/45.
|
11
|
+
|
12
|
+
As additional parameters, the generator will take attribute pairs described by name and type. These attributes will
|
13
|
+
be used to prepopulate the migration to create the table for the model and to give you a set of templates for the
|
14
|
+
view. For example, "scaffold_resource post title:string created_on:date body:text published:boolean" will give
|
15
|
+
you a model with those four attributes, forms to create and edit those models from, and an index that'll list them
|
16
|
+
all.
|
17
|
+
|
18
|
+
You don't have to think up all attributes up front, but it's a good idea of adding just the baseline of what's
|
19
|
+
needed to start really working with the resource.
|
20
|
+
|
21
|
+
Once the generator has run, you'll need to add a declaration to your config/routes.rb file to hook up the rules
|
22
|
+
that'll point URLs to this new resource. If you create a resource like "scaffold_resource post", you'll need to
|
23
|
+
add "map.resources :posts" (notice the plural form) in the routes file. Then your new resource is accessible from
|
24
|
+
/posts.
|
25
|
+
|
26
|
+
Examples:
|
27
|
+
./script/generate scaffold_resource post # no attributes, view will be anemic
|
28
|
+
./script/generate scaffold_resource post title:string created_on:date body:text published:boolean
|
29
|
+
./script/generate scaffold_resource purchase order_id:integer created_at:datetime amount:decimal
|
data/lib/rails_generator/generators/components/scaffold_resource/scaffold_resource_generator.rb
ADDED
@@ -0,0 +1,92 @@
|
|
1
|
+
class ScaffoldResourceGenerator < Rails::Generator::NamedBase
|
2
|
+
attr_reader :controller_name,
|
3
|
+
:controller_class_path,
|
4
|
+
:controller_file_path,
|
5
|
+
:controller_class_nesting,
|
6
|
+
:controller_class_nesting_depth,
|
7
|
+
:controller_class_name,
|
8
|
+
:controller_singular_name,
|
9
|
+
:controller_plural_name
|
10
|
+
alias_method :controller_file_name, :controller_singular_name
|
11
|
+
alias_method :controller_table_name, :controller_plural_name
|
12
|
+
|
13
|
+
def initialize(runtime_args, runtime_options = {})
|
14
|
+
super
|
15
|
+
|
16
|
+
@controller_name = @name.pluralize
|
17
|
+
|
18
|
+
base_name, @controller_class_path, @controller_file_path, @controller_class_nesting, @controller_class_nesting_depth = extract_modules(@controller_name)
|
19
|
+
@controller_class_name_without_nesting, @controller_singular_name, @controller_plural_name = inflect_names(base_name)
|
20
|
+
|
21
|
+
if @controller_class_nesting.empty?
|
22
|
+
@controller_class_name = @controller_class_name_without_nesting
|
23
|
+
else
|
24
|
+
@controller_class_name = "#{@controller_class_nesting}::#{@controller_class_name_without_nesting}"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def manifest
|
29
|
+
record do |m|
|
30
|
+
# Check for class naming collisions.
|
31
|
+
m.class_collisions(controller_class_path, "#{controller_class_name}Controller", "#{controller_class_name}Helper")
|
32
|
+
m.class_collisions(class_path, "#{class_name}")
|
33
|
+
|
34
|
+
# Controller, helper, views, and test directories.
|
35
|
+
m.directory(File.join('app/models', class_path))
|
36
|
+
m.directory(File.join('app/controllers', controller_class_path))
|
37
|
+
m.directory(File.join('app/helpers', controller_class_path))
|
38
|
+
m.directory(File.join('app/views', controller_class_path, controller_file_name))
|
39
|
+
m.directory(File.join('test/functional', controller_class_path))
|
40
|
+
m.directory(File.join('test/unit', class_path))
|
41
|
+
|
42
|
+
for action in scaffold_views
|
43
|
+
m.template(
|
44
|
+
"view_#{action}.rhtml",
|
45
|
+
File.join('app/views', controller_class_path, controller_file_name, "#{action}.rhtml")
|
46
|
+
)
|
47
|
+
end
|
48
|
+
|
49
|
+
# Layout and stylesheet.
|
50
|
+
m.template('layout.rhtml', File.join('app/views/layouts', controller_class_path, "#{controller_file_name}.rhtml"))
|
51
|
+
m.template('style.css', 'public/stylesheets/scaffold.css')
|
52
|
+
|
53
|
+
m.template('model.rb', File.join('app/models', class_path, "#{file_name}.rb"))
|
54
|
+
|
55
|
+
m.template(
|
56
|
+
'controller.rb', File.join('app/controllers', controller_class_path, "#{controller_file_name}_controller.rb")
|
57
|
+
)
|
58
|
+
|
59
|
+
m.template('functional_test.rb', File.join('test/functional', controller_class_path, "#{controller_file_name}_controller_test.rb"))
|
60
|
+
m.template('helper.rb', File.join('app/helpers', controller_class_path, "#{controller_file_name}_helper.rb"))
|
61
|
+
m.template('unit_test.rb', File.join('test/unit', class_path, "#{file_name}_test.rb"))
|
62
|
+
m.template('fixtures.yml', File.join('test/fixtures', "#{table_name}.yml"))
|
63
|
+
|
64
|
+
unless options[:skip_migration]
|
65
|
+
m.migration_template(
|
66
|
+
'migration.rb', 'db/migrate',
|
67
|
+
:assigns => {
|
68
|
+
:migration_name => "Create#{class_name.pluralize.gsub(/::/, '')}",
|
69
|
+
:attributes => attributes
|
70
|
+
},
|
71
|
+
:migration_file_name => "create_#{file_path.gsub(/\//, '_').pluralize}"
|
72
|
+
)
|
73
|
+
end
|
74
|
+
|
75
|
+
m.route_resources controller_file_name
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
protected
|
80
|
+
# Override with your own usage banner.
|
81
|
+
def banner
|
82
|
+
"Usage: #{$0} scaffold_resource ModelName [field:type, field:type]"
|
83
|
+
end
|
84
|
+
|
85
|
+
def scaffold_views
|
86
|
+
%w[ index show new edit ]
|
87
|
+
end
|
88
|
+
|
89
|
+
def model_name
|
90
|
+
class_name.demodulize
|
91
|
+
end
|
92
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
class <%= controller_class_name %>Controller < ApplicationController
|
2
|
+
# GET /<%= table_name %>
|
3
|
+
# GET /<%= table_name %>.xml
|
4
|
+
def index
|
5
|
+
@<%= table_name %> = <%= class_name %>.find(:all)
|
6
|
+
|
7
|
+
respond_to do |format|
|
8
|
+
format.html # index.rhtml
|
9
|
+
format.xml { render :xml => @<%= table_name %>.to_xml }
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
# GET /<%= table_name %>/1
|
14
|
+
# GET /<%= table_name %>/1.xml
|
15
|
+
def show
|
16
|
+
@<%= file_name %> = <%= class_name %>.find(params[:id])
|
17
|
+
|
18
|
+
respond_to do |format|
|
19
|
+
format.html # show.rhtml
|
20
|
+
format.xml { render :xml => @<%= file_name %>.to_xml }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
# GET /<%= table_name %>/new
|
25
|
+
def new
|
26
|
+
@<%= file_name %> = <%= class_name %>.new
|
27
|
+
end
|
28
|
+
|
29
|
+
# GET /<%= table_name %>/1;edit
|
30
|
+
def edit
|
31
|
+
@<%= file_name %> = <%= class_name %>.find(params[:id])
|
32
|
+
end
|
33
|
+
|
34
|
+
# POST /<%= table_name %>
|
35
|
+
# POST /<%= table_name %>.xml
|
36
|
+
def create
|
37
|
+
@<%= file_name %> = <%= class_name %>.new(params[:<%= file_name %>])
|
38
|
+
|
39
|
+
respond_to do |format|
|
40
|
+
if @<%= file_name %>.save
|
41
|
+
flash[:notice] = '<%= class_name %> was successfully created.'
|
42
|
+
format.html { redirect_to <%= file_name %>_url(@<%= file_name %>) }
|
43
|
+
format.xml { head :created, :location => <%= file_name %>_url(@<%= file_name %>) }
|
44
|
+
else
|
45
|
+
format.html { render :action => "new" }
|
46
|
+
format.xml { render :xml => @<%= file_name %>.errors.to_xml }
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
# PUT /<%= table_name %>/1
|
52
|
+
# PUT /<%= table_name %>/1.xml
|
53
|
+
def update
|
54
|
+
@<%= file_name %> = <%= class_name %>.find(params[:id])
|
55
|
+
|
56
|
+
respond_to do |format|
|
57
|
+
if @<%= file_name %>.update_attributes(params[:<%= file_name %>])
|
58
|
+
flash[:notice] = '<%= class_name %> was successfully updated.'
|
59
|
+
format.html { redirect_to <%= file_name %>_url(@<%= file_name %>) }
|
60
|
+
format.xml { head :ok }
|
61
|
+
else
|
62
|
+
format.html { render :action => "edit" }
|
63
|
+
format.xml { render :xml => @<%= file_name %>.errors.to_xml }
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
# DELETE /<%= table_name %>/1
|
69
|
+
# DELETE /<%= table_name %>/1.xml
|
70
|
+
def destroy
|
71
|
+
@<%= file_name %> = <%= class_name %>.find(params[:id])
|
72
|
+
@<%= file_name %>.destroy
|
73
|
+
|
74
|
+
respond_to do |format|
|
75
|
+
format.html { redirect_to <%= table_name %>_url }
|
76
|
+
format.xml { head :ok }
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
2
|
+
one:
|
3
|
+
id: 1
|
4
|
+
<% for attribute in attributes -%>
|
5
|
+
<%= attribute.name %>: <%= attribute.default %>
|
6
|
+
<% end -%>
|
7
|
+
two:
|
8
|
+
id: 2
|
9
|
+
<% for attribute in attributes -%>
|
10
|
+
<%= attribute.name %>: <%= attribute.default %>
|
11
|
+
<% end -%>
|
@@ -0,0 +1,57 @@
|
|
1
|
+
require File.dirname(__FILE__) + '<%= '/..' * controller_class_nesting_depth %>/../test_helper'
|
2
|
+
require '<%= controller_file_path %>_controller'
|
3
|
+
|
4
|
+
# Re-raise errors caught by the controller.
|
5
|
+
class <%= controller_class_name %>Controller; def rescue_action(e) raise e end; end
|
6
|
+
|
7
|
+
class <%= controller_class_name %>ControllerTest < Test::Unit::TestCase
|
8
|
+
fixtures :<%= table_name %>
|
9
|
+
|
10
|
+
def setup
|
11
|
+
@controller = <%= controller_class_name %>Controller.new
|
12
|
+
@request = ActionController::TestRequest.new
|
13
|
+
@response = ActionController::TestResponse.new
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_should_get_index
|
17
|
+
get :index
|
18
|
+
assert_response :success
|
19
|
+
assert assigns(:<%= table_name %>)
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_should_get_new
|
23
|
+
get :new
|
24
|
+
assert_response :success
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_should_create_<%= file_name %>
|
28
|
+
old_count = <%= class_name %>.count
|
29
|
+
post :create, :<%= file_name %> => { }
|
30
|
+
assert_equal old_count+1, <%= class_name %>.count
|
31
|
+
|
32
|
+
assert_redirected_to <%= file_name %>_path(assigns(:<%= file_name %>))
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_should_show_<%= file_name %>
|
36
|
+
get :show, :id => 1
|
37
|
+
assert_response :success
|
38
|
+
end
|
39
|
+
|
40
|
+
def test_should_get_edit
|
41
|
+
get :edit, :id => 1
|
42
|
+
assert_response :success
|
43
|
+
end
|
44
|
+
|
45
|
+
def test_should_update_<%= file_name %>
|
46
|
+
put :update, :id => 1, :<%= file_name %> => { }
|
47
|
+
assert_redirected_to <%= file_name %>_path(assigns(:<%= file_name %>))
|
48
|
+
end
|
49
|
+
|
50
|
+
def test_should_destroy_<%= file_name %>
|
51
|
+
old_count = <%= class_name %>.count
|
52
|
+
delete :destroy, :id => 1
|
53
|
+
assert_equal old_count-1, <%= class_name %>.count
|
54
|
+
|
55
|
+
assert_redirected_to <%= table_name %>_path
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
|
7
|
+
<title><%= controller_class_name %>: <%%= controller.action_name %></title>
|
8
|
+
<%%= stylesheet_link_tag 'scaffold' %>
|
9
|
+
</head>
|
10
|
+
<body>
|
11
|
+
|
12
|
+
<p style="color: green"><%%= flash[:notice] %></p>
|
13
|
+
|
14
|
+
<%%= yield %>
|
15
|
+
|
16
|
+
</body>
|
17
|
+
</html>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class <%= migration_name %> < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :<%= table_name %> do |t|
|
4
|
+
<% for attribute in attributes -%>
|
5
|
+
t.column :<%= attribute.name %>, :<%= attribute.type %>
|
6
|
+
<% end -%>
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.down
|
11
|
+
drop_table :<%= table_name %>
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,74 @@
|
|
1
|
+
body { background-color: #fff; color: #333; }
|
2
|
+
|
3
|
+
body, p, ol, ul, td {
|
4
|
+
font-family: verdana, arial, helvetica, sans-serif;
|
5
|
+
font-size: 13px;
|
6
|
+
line-height: 18px;
|
7
|
+
}
|
8
|
+
|
9
|
+
pre {
|
10
|
+
background-color: #eee;
|
11
|
+
padding: 10px;
|
12
|
+
font-size: 11px;
|
13
|
+
}
|
14
|
+
|
15
|
+
a { color: #000; }
|
16
|
+
a:visited { color: #666; }
|
17
|
+
a:hover { color: #fff; background-color:#000; }
|
18
|
+
|
19
|
+
.fieldWithErrors {
|
20
|
+
padding: 2px;
|
21
|
+
background-color: red;
|
22
|
+
display: table;
|
23
|
+
}
|
24
|
+
|
25
|
+
#errorExplanation {
|
26
|
+
width: 400px;
|
27
|
+
border: 2px solid red;
|
28
|
+
padding: 7px;
|
29
|
+
padding-bottom: 12px;
|
30
|
+
margin-bottom: 20px;
|
31
|
+
background-color: #f0f0f0;
|
32
|
+
}
|
33
|
+
|
34
|
+
#errorExplanation h2 {
|
35
|
+
text-align: left;
|
36
|
+
font-weight: bold;
|
37
|
+
padding: 5px 5px 5px 15px;
|
38
|
+
font-size: 12px;
|
39
|
+
margin: -7px;
|
40
|
+
background-color: #c00;
|
41
|
+
color: #fff;
|
42
|
+
}
|
43
|
+
|
44
|
+
#errorExplanation p {
|
45
|
+
color: #333;
|
46
|
+
margin-bottom: 0;
|
47
|
+
padding: 5px;
|
48
|
+
}
|
49
|
+
|
50
|
+
#errorExplanation ul li {
|
51
|
+
font-size: 12px;
|
52
|
+
list-style: square;
|
53
|
+
}
|
54
|
+
|
55
|
+
div.uploadStatus {
|
56
|
+
margin: 5px;
|
57
|
+
}
|
58
|
+
|
59
|
+
div.progressBar {
|
60
|
+
margin: 5px;
|
61
|
+
}
|
62
|
+
|
63
|
+
div.progressBar div.border {
|
64
|
+
background-color: #fff;
|
65
|
+
border: 1px solid grey;
|
66
|
+
width: 100%;
|
67
|
+
}
|
68
|
+
|
69
|
+
div.progressBar div.background {
|
70
|
+
background-color: #333;
|
71
|
+
height: 18px;
|
72
|
+
width: 0%;
|
73
|
+
}
|
74
|
+
|