Browse files

upgraded to rails 3

  • Loading branch information...
1 parent 7f8ef67 commit 5b05cbcd452b9f6f5dd9809c2da9a7e67e4b3a89 Jason Draper committed Oct 5, 2010
Showing with 9,146 additions and 150,584 deletions.
  1. +34 −0 Gemfile
  2. +78 −0 Gemfile.lock
  3. +142 −129 README
  4. +2 −5 Rakefile
  5. +2 −6 app/controllers/application_controller.rb
  6. +0 −5 app/helpers/application_helper.rb
  7. +7 −0 app/helpers/application_helper.rb.rails2
  8. +1 −1 app/models/ip.rb
  9. +3 −3 app/models/item.rb
  10. +1 −1 app/views/announcements/_form.html.erb
  11. +1 −1 app/views/buildings/edit.html.erb
  12. +1 −1 app/views/buildings/new.html.erb
  13. +1 −1 app/views/dns_names/edit.html.erb
  14. +1 −1 app/views/dns_names/new.html.erb
  15. +1 −1 app/views/ips/edit.html.erb
  16. +1 −1 app/views/ips/new.html.erb
  17. +2 −5 app/views/items/_form.html.erb
  18. +1 −1 app/views/items/edit.html.erb
  19. +1 −1 app/views/items/new.html.erb
  20. +3 −7 app/views/items/show.html.erb
  21. +1 −1 app/views/locations/edit.html.erb
  22. +1 −1 app/views/locations/new.html.erb
  23. +1 −1 app/views/operating_systems/edit.html.erb
  24. +1 −1 app/views/operating_systems/new.html.erb
  25. +1 −1 app/views/pages/_form.html.erb
  26. +10 −0 app/views/shared/_error_messages.html.erb
  27. +1 −1 app/views/softwares/edit.html.erb
  28. +1 −1 app/views/softwares/new.html.erb
  29. +1 −1 app/views/users/edit.html.erb
  30. +1 −1 app/views/users/new.html.erb
  31. +4 −0 config.ru
  32. +49 −0 config/application.rb
  33. +13 −110 config/boot.rb
  34. +4 −49 config/environment.rb
  35. +22 −13 config/environments/development.rb
  36. +17 −0 config/environments/development.rb.rails2
  37. +41 −20 config/environments/production.rb
  38. +28 −0 config/environments/production.rb.rails2
  39. +35 −28 config/environments/test.rb
  40. +2 −2 config/initializers/backtrace_silencers.rb
  41. +1 −1 config/initializers/inflections.rb
  42. +7 −0 config/initializers/secret_token.rb
  43. +2 −9 config/initializers/session_store.rb
  44. +52 −0 config/initializers/simple_form.rb
  45. +0 −11 config/locales/en.yml
  46. +24 −0 config/locales/simple_form.en.yml
  47. +53 −45 config/routes.rb
  48. +67 −0 config/routes.rb.rails2
  49. BIN db/development.sqlite3
  50. +2 −2 db/seeds.rb
  51. BIN db/test.sqlite3
  52. +2 −0 doc/README_FOR_APP.rails2
  53. 0 lib/tasks/.gitkeep
  54. +23 −0 lib/templates/erb/scaffold/_form.html.erb
  55. +2,361 −111,129 log/development.log
  56. +680 −37,177 log/test.log
  57. +15 −19 public/404.html
  58. +15 −19 public/422.html
  59. +14 −18 public/500.html
  60. +5 −3 public/javascripts/controls.js
  61. +7 −6 public/javascripts/dragdrop.js
  62. +8 −13 public/javascripts/effects.js
  63. +3,381 −1,700 public/javascripts/prototype.js
  64. +175 −0 public/javascripts/rails.js
  65. 0 public/stylesheets/.gitkeep
  66. +6 −0 script/rails
  67. +2 −2 test/performance/browsing_test.rb
  68. +4 −29 test/test_helper.rb
  69. 0 vendor/plugins/.gitkeep
  70. +20 −0 vendor/plugins/rails_upgrade/MIT-LICENSE
  71. +20 −0 vendor/plugins/rails_upgrade/README
  72. +22 −0 vendor/plugins/rails_upgrade/Rakefile
  73. +2 −0 vendor/plugins/rails_upgrade/init.rb
  74. +38 −0 vendor/plugins/rails_upgrade/install.rb
  75. +472 −0 vendor/plugins/rails_upgrade/lib/application_checker.rb
  76. +95 −0 vendor/plugins/rails_upgrade/lib/gemfile_generator.rb
  77. +51 −0 vendor/plugins/rails_upgrade/lib/new_configuration_generator.rb
  78. 0 vendor/plugins/rails_upgrade/lib/rails_upgrade.rb
  79. +349 −0 vendor/plugins/rails_upgrade/lib/routes_upgrader.rb
  80. +78 −0 vendor/plugins/rails_upgrade/lib/tasks/rails_upgrade_tasks.rake
  81. +293 −0 vendor/plugins/rails_upgrade/test/application_checker_test.rb
  82. +72 −0 vendor/plugins/rails_upgrade/test/gemfile_generator_test.rb
  83. +63 −0 vendor/plugins/rails_upgrade/test/new_configuration_generator_test.rb
  84. +142 −0 vendor/plugins/rails_upgrade/test/routes_upgrader_test.rb
  85. +5 −0 vendor/plugins/rails_upgrade/test/test_helper.rb
  86. +1 −0 vendor/plugins/rails_upgrade/uninstall.rb
View
34 Gemfile
@@ -0,0 +1,34 @@
+source 'http://rubygems.org'
+
+gem 'rails', '3.0.0'
+
+# Bundle edge Rails instead:
+# gem 'rails', :git => 'git://github.com/rails/rails.git'
+
+gem 'sqlite3-ruby', :require => 'sqlite3'
+
+# Use unicorn as the web server
+# gem 'unicorn'
+
+# Deploy with Capistrano
+# gem 'capistrano'
+
+# To use debugger
+# gem 'ruby-debug'
+
+# Bundle the extra gems:
+# gem 'bj'
+# gem 'nokogiri'
+# gem 'sqlite3-ruby', :require => 'sqlite3'
+# gem 'aws-s3', :require => 'aws/s3'
+
+# Bundle gems for the local environment. Make sure to
+# put test-only gems in this group so their generators
+# and rake tasks are available in development mode:
+# group :development, :test do
+# gem 'webrat'
+# end
+
+
+gem 'rubycas-client'
+gem "simple_form"
View
78 Gemfile.lock
@@ -0,0 +1,78 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ abstract (1.0.0)
+ actionmailer (3.0.0)
+ actionpack (= 3.0.0)
+ mail (~> 2.2.5)
+ actionpack (3.0.0)
+ activemodel (= 3.0.0)
+ activesupport (= 3.0.0)
+ builder (~> 2.1.2)
+ erubis (~> 2.6.6)
+ i18n (~> 0.4.1)
+ rack (~> 1.2.1)
+ rack-mount (~> 0.6.12)
+ rack-test (~> 0.5.4)
+ tzinfo (~> 0.3.23)
+ activemodel (3.0.0)
+ activesupport (= 3.0.0)
+ builder (~> 2.1.2)
+ i18n (~> 0.4.1)
+ activerecord (3.0.0)
+ activemodel (= 3.0.0)
+ activesupport (= 3.0.0)
+ arel (~> 1.0.0)
+ tzinfo (~> 0.3.23)
+ activeresource (3.0.0)
+ activemodel (= 3.0.0)
+ activesupport (= 3.0.0)
+ activesupport (3.0.0)
+ arel (1.0.1)
+ activesupport (~> 3.0.0)
+ builder (2.1.2)
+ erubis (2.6.6)
+ abstract (>= 1.0.0)
+ i18n (0.4.1)
+ mail (2.2.6.1)
+ activesupport (>= 2.3.6)
+ mime-types
+ treetop (>= 1.4.5)
+ mime-types (1.16)
+ polyglot (0.3.1)
+ rack (1.2.1)
+ rack-mount (0.6.13)
+ rack (>= 1.0.0)
+ rack-test (0.5.6)
+ rack (>= 1.0)
+ rails (3.0.0)
+ actionmailer (= 3.0.0)
+ actionpack (= 3.0.0)
+ activerecord (= 3.0.0)
+ activeresource (= 3.0.0)
+ activesupport (= 3.0.0)
+ bundler (~> 1.0.0)
+ railties (= 3.0.0)
+ railties (3.0.0)
+ actionpack (= 3.0.0)
+ activesupport (= 3.0.0)
+ rake (>= 0.8.4)
+ thor (~> 0.14.0)
+ rake (0.8.7)
+ rubycas-client (2.2.1)
+ activesupport
+ simple_form (1.2.2)
+ sqlite3-ruby (1.3.1)
+ thor (0.14.3)
+ treetop (1.4.8)
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.23)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ rails (= 3.0.0)
+ rubycas-client
+ simple_form
+ sqlite3-ruby
View
271 README
@@ -1,14 +1,15 @@
== Welcome to Rails
-Rails is a web-application framework that includes everything needed to create
-database-backed web applications according to the Model-View-Control pattern.
+Rails is a web-application framework that includes everything needed to create
+database-backed web applications according to the Model-View-Control pattern.
-This pattern splits the view (also called the presentation) into "dumb" templates
-that are primarily responsible for inserting pre-built data in between HTML tags.
-The model contains the "smart" domain objects (such as Account, Product, Person,
-Post) that holds all the business logic and knows how to persist themselves to
-a database. The controller handles the incoming requests (such as Save New Account,
-Update Product, Show Post) by manipulating the model and directing data to the view.
+This pattern splits the view (also called the presentation) into "dumb"
+templates that are primarily responsible for inserting pre-built data in between
+HTML tags. The model contains the "smart" domain objects (such as Account,
+Product, Person, Post) that holds all the business logic and knows how to
+persist themselves to a database. The controller handles the incoming requests
+(such as Save New Account, Update Product, Show Post) by manipulating the model
+and directing data to the view.
In Rails, the model is handled by what's called an object-relational mapping
layer entitled Active Record. This layer allows you to present the data from
@@ -21,89 +22,40 @@ layers by its two parts: Action View and Action Controller. These two layers
are bundled in a single package due to their heavy interdependence. This is
unlike the relationship between the Active Record and Action Pack that is much
more separate. Each of these packages can be used independently outside of
-Rails. You can read more about Action Pack in
+Rails. You can read more about Action Pack in
link:files/vendor/rails/actionpack/README.html.
== Getting Started
-1. At the command prompt, start a new Rails application using the <tt>rails</tt> command
- and your application name. Ex: rails myapp
-2. Change directory into myapp and start the web server: <tt>script/server</tt> (run with --help for options)
-3. Go to http://localhost:3000/ and get "Welcome aboard: You're riding the Rails!"
-4. Follow the guidelines to start developing your application
+1. At the command prompt, create a new Rails application:
+ <tt>rails new myapp</tt> (where <tt>myapp</tt> is the application name)
+2. Change directory to <tt>myapp</tt> and start the web server:
+ <tt>cd myapp; rails server</tt> (run with --help for options)
-== Web Servers
+3. Go to http://localhost:3000/ and you'll see:
+ "Welcome aboard: You're riding Ruby on Rails!"
-By default, Rails will try to use Mongrel if it's are installed when started with script/server, otherwise Rails will use WEBrick, the webserver that ships with Ruby. But you can also use Rails
-with a variety of other web servers.
+4. Follow the guidelines to start developing your application. You can find
+the following resources handy:
-Mongrel is a Ruby-based webserver with a C component (which requires compilation) that is
-suitable for development and deployment of Rails applications. If you have Ruby Gems installed,
-getting up and running with mongrel is as easy as: <tt>gem install mongrel</tt>.
-More info at: http://mongrel.rubyforge.org
-
-Say other Ruby web servers like Thin and Ebb or regular web servers like Apache or LiteSpeed or
-Lighttpd or IIS. The Ruby web servers are run through Rack and the latter can either be setup to use
-FCGI or proxy to a pack of Mongrels/Thin/Ebb servers.
-
-== Apache .htaccess example for FCGI/CGI
-
-# General Apache options
-AddHandler fastcgi-script .fcgi
-AddHandler cgi-script .cgi
-Options +FollowSymLinks +ExecCGI
-
-# If you don't want Rails to look in certain directories,
-# use the following rewrite rules so that Apache won't rewrite certain requests
-#
-# Example:
-# RewriteCond %{REQUEST_URI} ^/notrails.*
-# RewriteRule .* - [L]
-
-# Redirect all requests not available on the filesystem to Rails
-# By default the cgi dispatcher is used which is very slow
-#
-# For better performance replace the dispatcher with the fastcgi one
-#
-# Example:
-# RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
-RewriteEngine On
-
-# If your Rails application is accessed via an Alias directive,
-# then you MUST also set the RewriteBase in this htaccess file.
-#
-# Example:
-# Alias /myrailsapp /path/to/myrailsapp/public
-# RewriteBase /myrailsapp
-
-RewriteRule ^$ index.html [QSA]
-RewriteRule ^([^.]+)$ $1.html [QSA]
-RewriteCond %{REQUEST_FILENAME} !-f
-RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
-
-# In case Rails experiences terminal errors
-# Instead of displaying this message you can supply a file here which will be rendered instead
-#
-# Example:
-# ErrorDocument 500 /500.html
-
-ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"
+* The Getting Started Guide: http://guides.rubyonrails.org/getting_started.html
+* Ruby on Rails Tutorial Book: http://www.railstutorial.org/
== Debugging Rails
-Sometimes your application goes wrong. Fortunately there are a lot of tools that
+Sometimes your application goes wrong. Fortunately there are a lot of tools that
will help you debug it and get it back on the rails.
-First area to check is the application log files. Have "tail -f" commands running
-on the server.log and development.log. Rails will automatically display debugging
-and runtime information to these files. Debugging info will also be shown in the
-browser on requests from 127.0.0.1.
+First area to check is the application log files. Have "tail -f" commands
+running on the server.log and development.log. Rails will automatically display
+debugging and runtime information to these files. Debugging info will also be
+shown in the browser on requests from 127.0.0.1.
-You can also log your own messages directly into the log file from your code using
-the Ruby logger class from inside your controllers. Example:
+You can also log your own messages directly into the log file from your code
+using the Ruby logger class from inside your controllers. Example:
class WeblogController < ActionController::Base
def destroy
@@ -115,26 +67,27 @@ the Ruby logger class from inside your controllers. Example:
The result will be a message in your log file along the lines of:
- Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1
+ Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1!
More information on how to use the logger is at http://www.ruby-doc.org/core/
-Also, Ruby documentation can be found at http://www.ruby-lang.org/ including:
+Also, Ruby documentation can be found at http://www.ruby-lang.org/. There are
+several books available online as well:
-* The Learning Ruby (Pickaxe) Book: http://www.ruby-doc.org/docs/ProgrammingRuby/
-* Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide)
+* Programming Ruby: http://www.ruby-doc.org/docs/ProgrammingRuby/ (Pickaxe)
+* Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide)
-These two online (and free) books will bring you up to speed on the Ruby language
-and also on programming in general.
+These two books will bring you up to speed on the Ruby language and also on
+programming in general.
== Debugger
-Debugger support is available through the debugger command when you start your Mongrel or
-Webrick server with --debugger. This means that you can break out of execution at any point
-in the code, investigate and change the model, AND then resume execution!
-You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install ruby-debug'
-Example:
+Debugger support is available through the debugger command when you start your
+Mongrel or WEBrick server with --debugger. This means that you can break out of
+execution at any point in the code, investigate and change the model, and then,
+resume execution! You need to install ruby-debug to run the server in debugging
+mode. With gems, use <tt>sudo gem install ruby-debug</tt>. Example:
class WeblogController < ActionController::Base
def index
@@ -147,97 +100,157 @@ So the controller will accept the action, run the first line, then present you
with a IRB prompt in the server window. Here you can do things like:
>> @posts.inspect
- => "[#<Post:0x14a6be8 @attributes={\"title\"=>nil, \"body\"=>nil, \"id\"=>\"1\"}>,
- #<Post:0x14a6620 @attributes={\"title\"=>\"Rails you know!\", \"body\"=>\"Only ten..\", \"id\"=>\"2\"}>]"
+ => "[#<Post:0x14a6be8
+ @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>,
+ #<Post:0x14a6620
+ @attributes={"title"=>"Rails", "body"=>"Only ten..", "id"=>"2"}>]"
>> @posts.first.title = "hello from a debugger"
=> "hello from a debugger"
-...and even better is that you can examine how your runtime objects actually work:
+...and even better, you can examine how your runtime objects actually work:
>> f = @posts.first
=> #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
>> f.
Display all 152 possibilities? (y or n)
-Finally, when you're ready to resume execution, you enter "cont"
+Finally, when you're ready to resume execution, you can enter "cont".
== Console
-You can interact with the domain model by starting the console through <tt>script/console</tt>.
-Here you'll have all parts of the application configured, just like it is when the
-application is running. You can inspect domain models, change values, and save to the
-database. Starting the script without arguments will launch it in the development environment.
-Passing an argument will specify a different environment, like <tt>script/console production</tt>.
+The console is a Ruby shell, which allows you to interact with your
+application's domain model. Here you'll have all parts of the application
+configured, just like it is when the application is running. You can inspect
+domain models, change values, and save to the database. Starting the script
+without arguments will launch it in the development environment.
+
+To start the console, run <tt>rails console</tt> from the application
+directory.
+
+Options:
+
+* Passing the <tt>-s, --sandbox</tt> argument will rollback any modifications
+ made to the database.
+* Passing an environment name as an argument will load the corresponding
+ environment. Example: <tt>rails console production</tt>.
+
+To reload your controllers and models after launching the console run
+<tt>reload!</tt>
+
+More information about irb can be found at:
+link:http://www.rubycentral.com/pickaxe/irb.html
-To reload your controllers and models after launching the console run <tt>reload!</tt>
== dbconsole
-You can go to the command line of your database directly through <tt>script/dbconsole</tt>.
-You would be connected to the database with the credentials defined in database.yml.
-Starting the script without arguments will connect you to the development database. Passing an
-argument will connect you to a different database, like <tt>script/dbconsole production</tt>.
-Currently works for mysql, postgresql and sqlite.
+You can go to the command line of your database directly through <tt>rails
+dbconsole</tt>. You would be connected to the database with the credentials
+defined in database.yml. Starting the script without arguments will connect you
+to the development database. Passing an argument will connect you to a different
+database, like <tt>rails dbconsole production</tt>. Currently works for MySQL,
+PostgreSQL and SQLite 3.
== Description of Contents
+The default directory structure of a generated Ruby on Rails application:
+
+ |-- app
+ | |-- controllers
+ | |-- helpers
+ | |-- models
+ | `-- views
+ | `-- layouts
+ |-- config
+ | |-- environments
+ | |-- initializers
+ | `-- locales
+ |-- db
+ |-- doc
+ |-- lib
+ | `-- tasks
+ |-- log
+ |-- public
+ | |-- images
+ | |-- javascripts
+ | `-- stylesheets
+ |-- script
+ | `-- performance
+ |-- test
+ | |-- fixtures
+ | |-- functional
+ | |-- integration
+ | |-- performance
+ | `-- unit
+ |-- tmp
+ | |-- cache
+ | |-- pids
+ | |-- sessions
+ | `-- sockets
+ `-- vendor
+ `-- plugins
+
app
Holds all the code that's specific to this particular application.
app/controllers
Holds controllers that should be named like weblogs_controller.rb for
- automated URL mapping. All controllers should descend from ApplicationController
- which itself descends from ActionController::Base.
+ automated URL mapping. All controllers should descend from
+ ApplicationController which itself descends from ActionController::Base.
app/models
- Holds models that should be named like post.rb.
- Most models will descend from ActiveRecord::Base.
+ Holds models that should be named like post.rb. Models descend from
+ ActiveRecord::Base by default.
app/views
Holds the template files for the view that should be named like
- weblogs/index.html.erb for the WeblogsController#index action. All views use eRuby
- syntax.
+ weblogs/index.html.erb for the WeblogsController#index action. All views use
+ eRuby syntax by default.
app/views/layouts
- Holds the template files for layouts to be used with views. This models the common
- header/footer method of wrapping views. In your views, define a layout using the
- <tt>layout :default</tt> and create a file named default.html.erb. Inside default.html.erb,
- call <% yield %> to render the view using this layout.
+ Holds the template files for layouts to be used with views. This models the
+ common header/footer method of wrapping views. In your views, define a layout
+ using the <tt>layout :default</tt> and create a file named default.html.erb.
+ Inside default.html.erb, call <% yield %> to render the view using this
+ layout.
app/helpers
- Holds view helpers that should be named like weblogs_helper.rb. These are generated
- for you automatically when using script/generate for controllers. Helpers can be used to
- wrap functionality for your views into methods.
+ Holds view helpers that should be named like weblogs_helper.rb. These are
+ generated for you automatically when using generators for controllers.
+ Helpers can be used to wrap functionality for your views into methods.
config
- Configuration files for the Rails environment, the routing map, the database, and other dependencies.
+ Configuration files for the Rails environment, the routing map, the database,
+ and other dependencies.
db
- Contains the database schema in schema.rb. db/migrate contains all
- the sequence of Migrations for your schema.
+ Contains the database schema in schema.rb. db/migrate contains all the
+ sequence of Migrations for your schema.
doc
- This directory is where your application documentation will be stored when generated
- using <tt>rake doc:app</tt>
+ This directory is where your application documentation will be stored when
+ generated using <tt>rake doc:app</tt>
lib
- Application specific libraries. Basically, any kind of custom code that doesn't
- belong under controllers, models, or helpers. This directory is in the load path.
+ Application specific libraries. Basically, any kind of custom code that
+ doesn't belong under controllers, models, or helpers. This directory is in
+ the load path.
public
- The directory available for the web server. Contains subdirectories for images, stylesheets,
- and javascripts. Also contains the dispatchers and the default HTML files. This should be
- set as the DOCUMENT_ROOT of your web server.
+ The directory available for the web server. Contains subdirectories for
+ images, stylesheets, and javascripts. Also contains the dispatchers and the
+ default HTML files. This should be set as the DOCUMENT_ROOT of your web
+ server.
script
Helper scripts for automation and generation.
test
- Unit and functional tests along with fixtures. When using the script/generate scripts, template
- test files will be generated for you and placed in this directory.
+ Unit and functional tests along with fixtures. When using the rails generate
+ command, template test files will be generated for you and placed in this
+ directory.
vendor
- External libraries that the application depends on. Also includes the plugins subdirectory.
- If the app has frozen rails, those gems also go here, under vendor/rails/.
- This directory is in the load path.
+ External libraries that the application depends on. Also includes the plugins
+ subdirectory. If the app has frozen rails, those gems also go here, under
+ vendor/rails/. This directory is in the load path.
View
7 Rakefile
@@ -1,10 +1,7 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
-require(File.join(File.dirname(__FILE__), 'config', 'boot'))
-
+require File.expand_path('../config/application', __FILE__)
require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
-require 'tasks/rails'
+Findit::Application.load_tasks
View
8 app/controllers/application_controller.rb
@@ -1,12 +1,10 @@
-# Filters added to this controller apply to all controllers in the application.
-# Likewise, all the methods added will be available for all controllers.
-
class ApplicationController < ActionController::Base
+ protect_from_forgery
helper :all # include all helpers, all the time
protect_from_forgery # See ActionController::RequestForgeryProtection for details
# Scrub sensitive parameters from your log
# filter_parameter_logging :password
- if ENV['RAILS_ENV'] == "development"
+ if Rails.env == "development"
before_filter :set_login
else
before_filter CASClient::Frameworks::Rails::Filter
@@ -40,7 +38,5 @@ def check_for_valid_login
CASClient::Frameworks::Rails::Filter.logout(self)
end
end
-
-
end
View
5 app/helpers/application_helper.rb
@@ -1,7 +1,2 @@
-# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
-
- def set_focus_to_id(id)
- javascript_tag("$('#{id}').focus()");
- end
end
View
7 app/helpers/application_helper.rb.rails2
@@ -0,0 +1,7 @@
+# Methods added to this helper will be available to all templates in the application.
+module ApplicationHelper
+
+ def set_focus_to_id(id)
+ javascript_tag("$('#{id}').focus()");
+ end
+end
View
2 app/models/ip.rb
@@ -4,7 +4,7 @@ class Ip < ActiveRecord::Base
validates_presence_of :number
belongs_to :item
belongs_to :building
- named_scope :unassigned, :conditions=>['item_id IS NULL']
+ scope :unassigned, :conditions=>['item_id IS NULL']
default_scope :order=>['number ASC']
def last_octet
View
6 app/models/item.rb
@@ -3,8 +3,8 @@ class Item < ActiveRecord::Base
has_many :installations, :dependent=>:destroy
has_many :softwares, :through=>:installations
has_many :dns_names, :dependent=>:nullify
- named_scope :has_ip, :include=> :ips, :conditions=>["ips.id in (SELECT id from ips)"]
- named_scope :proc_ratings, :conditions => 'processor_rating IS NOT NULL', :order=>"processor_rating"
+ scope :has_ip, :include=> :ips, :conditions=>["ips.id in (SELECT id from ips)"]
+ scope :proc_ratings, :conditions => 'processor_rating IS NOT NULL', :order=>"processor_rating"
attr_accessor :new_dns_names
before_save :create_dns_from_names
before_save :convert_size_to_bytes
@@ -18,7 +18,7 @@ class Item < ActiveRecord::Base
validates_presence_of :type_of_item
validates_inclusion_of :type_of_item, :in =>["Desktop", "Laptop", "Printer", "Virtual Machine", "Other", "Server"], :message => "Type of item can only be Desktop Laptop Printer Virtual Machine, Server or Other"
before_validation :clear_empty_attrs
- named_scope :by_type, lambda { |type| {:conditions => {:type_of_item=>type} } }
+ scope :by_type, lambda { |type| {:conditions => {:type_of_item=>type} } }
def create_dns_from_names
unless new_dns_names.blank?
View
2 app/views/announcements/_form.html.erb
@@ -1,4 +1,4 @@
-<% form_for @announcement do |f| %>
+<%= form_for @announcement do |f| %>
<%= f.error_messages %>
<p>
<%= f.label :name %><br />
View
2 app/views/buildings/edit.html.erb
@@ -9,7 +9,7 @@
<div class="content">
<h2 class="title"><%= t("web-app-theme.edit", :default => "Edit") %> Building</h2>
<div class="inner">
- <% form_for @building, :url => building_path(@building), :html => { :class => :form } do |f| -%>
+ <%= form_for @building, :url => building_path(@building), :html => { :class => :form } do |f| -%>
<%= render :partial => "form", :locals => {:f => f} %>
<% end -%>
</div>
View
2 app/views/buildings/new.html.erb
@@ -8,7 +8,7 @@
<div class="content">
<h2 class="title"><%= t("web-app-theme.new", :default => "New")%> Building</h2>
<div class="inner">
- <% form_for :building, :url => buildings_path, :html => { :class => :form } do |f| -%>
+ <%= form_for :building, :url => buildings_path, :html => { :class => :form } do |f| -%>
<%= render :partial => "form", :locals => {:f => f} %>
<% end -%>
</div>
View
2 app/views/dns_names/edit.html.erb
@@ -9,7 +9,7 @@
<div class="content">
<h2 class="title"><%= t("web-app-theme.edit", :default => "Edit") %> DnsName</h2>
<div class="inner">
- <% form_for @dns_name, :url => dns_name_path(@dns_name), :html => { :class => :form } do |f| -%>
+ <%= form_for @dns_name, :url => dns_name_path(@dns_name), :html => { :class => :form } do |f| -%>
<%= render :partial => "form", :locals => {:f => f} %>
<% end -%>
</div>
View
2 app/views/dns_names/new.html.erb
@@ -8,7 +8,7 @@
<div class="content">
<h2 class="title"><%= t("web-app-theme.new", :default => "New")%> DnsName</h2>
<div class="inner">
- <% form_for :dns_name, :url => dns_names_path, :html => { :class => :form } do |f| -%>
+ <%= form_for :dns_name, :url => dns_names_path, :html => { :class => :form } do |f| -%>
<%= render :partial => "form", :locals => {:f => f} %>
<% end -%>
</div>
View
2 app/views/ips/edit.html.erb
@@ -9,7 +9,7 @@
<div class="content">
<h2 class="title"><%= t("web-app-theme.edit", :default => "Edit") %> Ip</h2>
<div class="inner">
- <% form_for @ip, :url => ip_path(@ip), :html => { :class => :form } do |f| -%>
+ <%= form_for @ip, :url => ip_path(@ip), :html => { :class => :form } do |f| -%>
<%= render :partial => "form", :locals => {:f => f} %>
<% end -%>
</div>
View
2 app/views/ips/new.html.erb
@@ -8,7 +8,7 @@
<div class="content">
<h2 class="title"><%= t("web-app-theme.new", :default => "New")%> Ip</h2>
<div class="inner">
- <% form_for :ip, :url => ips_path, :html => { :class => :form } do |f| -%>
+ <%= form_for :ip, :url => ips_path, :html => { :class => :form } do |f| -%>
<%= render :partial => "form", :locals => {:f => f} %>
<% end -%>
</div>
View
7 app/views/items/_form.html.erb
@@ -1,7 +1,4 @@
-<div>
- <%= f.error_messages %>
-</div>
-
+<%= render "shared/error_messages", :target=>@item %>
<div class="group">
<%= f.label :name, t("activerecord.attributes.item.name", :default => "Name"), :class => :label %>
@@ -23,7 +20,7 @@
</div>
<div class="group">
<%= f.label :user_id, t("activerecord.attributes.item.user_id", :default => "Primary User/Responsible Party"), :class => :label %>
- <%= f.collection_select(:user_id, User.find(:all, :order=>"first_name"), :id, :full_name, {:prompt => true}) %>
+ <%= f.collection_select(:user_id, User.order("first_name"), :id, :full_name, {:prompt => true}) %>
</div>
<div class="group">
View
2 app/views/items/edit.html.erb
@@ -9,7 +9,7 @@
<div class="content">
<h2 class="title"><%= t("web-app-theme.edit", :default => "Edit") %> Item</h2>
<div class="inner">
- <% form_for @item, :url => item_path(@item), :html => { :class => :form } do |f| -%>
+ <%= form_for @item, :url => item_path(@item), :html => { :class => :form } do |f| -%>
<%= render :partial => "form", :locals => {:f => f} %>
<% end -%>
</div>
View
2 app/views/items/new.html.erb
@@ -8,7 +8,7 @@
<div class="content">
<h2 class="title"><%= t("web-app-theme.new", :default => "New")%> Item</h2>
<div class="inner">
- <% form_for :item, :url => items_path, :html => { :class => :form } do |f| -%>
+ <%= form_for :item, :url => items_path, :html => { :class => :form } do |f| -%>
<%= render :partial => "form", :locals => {:f => f} %>
<% end -%>
</div>
View
10 app/views/items/show.html.erb
@@ -136,7 +136,7 @@
</ul>
<% end %>
- <% form_tag :action=>'add_ip' , :item=>@item do %>
+ <%= form_tag :action=>'add_ip' , :item=>@item do %>
<select id="ip_selection" name="ip_selection">
<% Ip.unassigned.each do |ip| %>
<option value='<%= ip.id %>'><%= ip.number %></option>
@@ -161,20 +161,16 @@
</ul>
<% end %>
- <% form_tag :controller=>'installations',:action=>'install_software' , :item=>@item do %>
+ <%= form_tag :controller=>'installations',:action=>'install_software' , :item=>@item do %>
<select id="software_selection" name="software_selection">
<% Software.all.each do |software| %>
<option value='<%= software.id %>'><%= software.name %></option>
<% end %>
</select>
<%= submit_tag 'Install Software' %>
<% end %>
-
-
+
</p>
-
-
-
<p>
<strong>DNS Names</strong>
<% if @item.dns_names.count > 0 %>
View
2 app/views/locations/edit.html.erb
@@ -9,7 +9,7 @@
<div class="content">
<h2 class="title"><%= t("web-app-theme.edit", :default => "Edit") %> Location</h2>
<div class="inner">
- <% form_for @location, :url => location_path(@location), :html => { :class => :form } do |f| -%>
+ <%= form_for @location, :url => location_path(@location), :html => { :class => :form } do |f| -%>
<%= render :partial => "form", :locals => {:f => f} %>
<% end -%>
</div>
View
2 app/views/locations/new.html.erb
@@ -8,7 +8,7 @@
<div class="content">
<h2 class="title"><%= t("web-app-theme.new", :default => "New")%> Location</h2>
<div class="inner">
- <% form_for :location, :url => locations_path, :html => { :class => :form } do |f| -%>
+ <%= form_for :location, :url => locations_path, :html => { :class => :form } do |f| -%>
<%= render :partial => "form", :locals => {:f => f} %>
<% end -%>
</div>
View
2 app/views/operating_systems/edit.html.erb
@@ -9,7 +9,7 @@
<div class="content">
<h2 class="title"><%= t("web-app-theme.edit", :default => "Edit") %> OperatingSystem</h2>
<div class="inner">
- <% form_for @operating_system, :url => operating_system_path(@operating_system), :html => { :class => :form } do |f| -%>
+ <%= form_for @operating_system, :url => operating_system_path(@operating_system), :html => { :class => :form } do |f| -%>
<%= render :partial => "form", :locals => {:f => f} %>
<% end -%>
</div>
View
2 app/views/operating_systems/new.html.erb
@@ -8,7 +8,7 @@
<div class="content">
<h2 class="title"><%= t("web-app-theme.new", :default => "New")%> OperatingSystem</h2>
<div class="inner">
- <% form_for :operating_system, :url => operating_systems_path, :html => { :class => :form } do |f| -%>
+ <%= form_for :operating_system, :url => operating_systems_path, :html => { :class => :form } do |f| -%>
<%= render :partial => "form", :locals => {:f => f} %>
<% end -%>
</div>
View
2 app/views/pages/_form.html.erb
@@ -1,4 +1,4 @@
-<% form_for @page do |f| %>
+<%= form_for @page do |f| %>
<%= f.error_messages %>
<p>
<%= f.label :title %><br />
View
10 app/views/shared/_error_messages.html.erb
@@ -0,0 +1,10 @@
+<% if target.errors.any? %>
+<div id="errorExplanation">
+ <h2><%= pluralize(target.errors.count, "error") %> prohibited this record from being saved:</h2>
+ <ul>
+ <% target.errors.full_messages.each do |msg| %>
+ <li><%= msg %></li>
+ <% end %>
+ </ul>
+</div>
+<% end %>
View
2 app/views/softwares/edit.html.erb
@@ -9,7 +9,7 @@
<div class="content">
<h2 class="title"><%= t("web-app-theme.edit", :default => "Edit") %> Software</h2>
<div class="inner">
- <% form_for @software, :url => software_path(@software), :html => { :class => :form } do |f| -%>
+ <%= form_for @software, :url => software_path(@software), :html => { :class => :form } do |f| -%>
<%= render :partial => "form", :locals => {:f => f} %>
<% end -%>
</div>
View
2 app/views/softwares/new.html.erb
@@ -8,7 +8,7 @@
<div class="content">
<h2 class="title"><%= t("web-app-theme.new", :default => "New")%> Software</h2>
<div class="inner">
- <% form_for :software, :url => softwares_path, :html => { :class => :form } do |f| -%>
+ <%= form_for :software, :url => softwares_path, :html => { :class => :form } do |f| -%>
<%= render :partial => "form", :locals => {:f => f} %>
<% end -%>
</div>
View
2 app/views/users/edit.html.erb
@@ -9,7 +9,7 @@
<div class="content">
<h2 class="title"><%= t("web-app-theme.edit", :default => "Edit") %> User</h2>
<div class="inner">
- <% form_for @user, :url => user_path(@user), :html => { :class => :form } do |f| -%>
+ <%= form_for @user, :url => user_path(@user), :html => { :class => :form } do |f| -%>
<%= render :partial => "form", :locals => {:f => f} %>
<% end -%>
</div>
View
2 app/views/users/new.html.erb
@@ -8,7 +8,7 @@
<div class="content">
<h2 class="title"><%= t("web-app-theme.new", :default => "New")%> User</h2>
<div class="inner">
- <% form_for :user, :url => users_path, :html => { :class => :form } do |f| -%>
+ <%= form_for :user, :url => users_path, :html => { :class => :form } do |f| -%>
<%= render :partial => "form", :locals => {:f => f} %>
<% end -%>
</div>
View
4 config.ru
@@ -0,0 +1,4 @@
+# This file is used by Rack-based servers to start the application.
+
+require ::File.expand_path('../config/environment', __FILE__)
+run Findit::Application
View
49 config/application.rb
@@ -0,0 +1,49 @@
+require File.expand_path('../boot', __FILE__)
+
+require 'rails/all'
+
+# If you have a Gemfile, require the gems listed there, including any gems
+# you've limited to :test, :development, or :production.
+Bundler.require(:default, Rails.env) if defined?(Bundler)
+
+module Findit
+ class Application < Rails::Application
+ # Settings in config/environments/* take precedence over those specified here.
+ # Application configuration should go into files in config/initializers
+ # -- all .rb files in that directory are automatically loaded.
+
+ # Custom directories with classes and modules you want to be autoloadable.
+ # config.autoload_paths += %W(#{config.root}/extras)
+
+ # Only load the plugins named here, in the order given (default is alphabetical).
+ # :all can be used as a placeholder for all plugins not explicitly named.
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
+
+ # Activate observers that should always be running.
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
+
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
+ # config.time_zone = 'Central Time (US & Canada)'
+ config.time_zone = 'Eastern Time (US & Canada)'
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
+ # config.i18n.default_locale = :de
+
+ # JavaScript files you want as :defaults (application.js is always included).
+ # config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
+
+ # Configure the default encoding used in templates for Ruby 1.9.
+ config.encoding = "utf-8"
+
+ # Configure sensitive parameters which will be filtered from the log file.
+ config.filter_parameters += [:password]
+
+ end
+ require 'casclient'
+ require 'casclient/frameworks/rails/filter'
+ CASClient::Frameworks::Rails::Filter.configure(
+ :cas_base_url => "https://auth.vt.edu/"
+ )
+
+end
View
123 config/boot.rb
@@ -1,110 +1,13 @@
-# Don't change this file!
-# Configure your app in config/environment.rb and config/environments/*.rb
-
-RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
-
-module Rails
- class << self
- def boot!
- unless booted?
- preinitialize
- pick_boot.run
- end
- end
-
- def booted?
- defined? Rails::Initializer
- end
-
- def pick_boot
- (vendor_rails? ? VendorBoot : GemBoot).new
- end
-
- def vendor_rails?
- File.exist?("#{RAILS_ROOT}/vendor/rails")
- end
-
- def preinitialize
- load(preinitializer_path) if File.exist?(preinitializer_path)
- end
-
- def preinitializer_path
- "#{RAILS_ROOT}/config/preinitializer.rb"
- end
- end
-
- class Boot
- def run
- load_initializer
- Rails::Initializer.run(:set_load_path)
- end
- end
-
- class VendorBoot < Boot
- def load_initializer
- require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
- Rails::Initializer.run(:install_gem_spec_stubs)
- Rails::GemDependency.add_frozen_gem_path
- end
- end
-
- class GemBoot < Boot
- def load_initializer
- self.class.load_rubygems
- load_rails_gem
- require 'initializer'
- end
-
- def load_rails_gem
- if version = self.class.gem_version
- gem 'rails', version
- else
- gem 'rails'
- end
- rescue Gem::LoadError => load_error
- $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
- exit 1
- end
-
- class << self
- def rubygems_version
- Gem::RubyGemsVersion rescue nil
- end
-
- def gem_version
- if defined? RAILS_GEM_VERSION
- RAILS_GEM_VERSION
- elsif ENV.include?('RAILS_GEM_VERSION')
- ENV['RAILS_GEM_VERSION']
- else
- parse_gem_version(read_environment_rb)
- end
- end
-
- def load_rubygems
- min_version = '1.3.2'
- require 'rubygems'
- unless rubygems_version >= min_version
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
- exit 1
- end
-
- rescue LoadError
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
- exit 1
- end
-
- def parse_gem_version(text)
- $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
- end
-
- private
- def read_environment_rb
- File.read("#{RAILS_ROOT}/config/environment.rb")
- end
- end
- end
-end
-
-# All that for this:
-Rails.boot!
+require 'rubygems'
+
+# Set up gems listed in the Gemfile.
+gemfile = File.expand_path('../../Gemfile', __FILE__)
+begin
+ ENV['BUNDLE_GEMFILE'] = gemfile
+ require 'bundler'
+ Bundler.setup
+rescue Bundler::GemNotFound => e
+ STDERR.puts e.message
+ STDERR.puts "Try running `bundle install`."
+ exit!
+end if File.exist?(gemfile)
View
53 config/environment.rb
@@ -1,50 +1,5 @@
-# Be sure to restart your server when you modify this file
+# Load the rails application
+require File.expand_path('../application', __FILE__)
-# Specifies gem version of Rails to use when vendor/rails is not present
-RAILS_GEM_VERSION = '2.3.8' unless defined? RAILS_GEM_VERSION
-
-# Bootstrap the Rails environment, frameworks, and default configuration
-require File.join(File.dirname(__FILE__), 'boot')
-
-Rails::Initializer.run do |config|
- # Settings in config/environments/* take precedence over those specified here.
- # Application configuration should go into files in config/initializers
- # -- all .rb files in that directory are automatically loaded.
-
- # Add additional load paths for your own custom dirs
- # config.load_paths += %W( #{RAILS_ROOT}/extras )
-
- # Specify gems that this application depends on and have them installed with rake gems:install
- # config.gem "bj"
- # config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
- # config.gem "sqlite3-ruby", :lib => "sqlite3"
- # config.gem "aws-s3", :lib => "aws/s3"
-
- # Only load the plugins named here, in the order given (default is alphabetical).
- # :all can be used as a placeholder for all plugins not explicitly named
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
-
- # Skip frameworks you're not going to use. To use Rails without a database,
- # you must remove the Active Record framework.
- # config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
-
- # Activate observers that should always be running
- # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
-
- # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
- # Run "rake -D time" for a list of tasks for finding time zone names.
- config.time_zone = 'UTC'
-
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')]
- # config.i18n.default_locale = :de
-
-
-end
-
-
-require 'casclient'
-require 'casclient/frameworks/rails/filter'
-CASClient::Frameworks::Rails::Filter.configure(
- :cas_base_url => "https://auth.vt.edu/"
-)
+# Initialize the rails application
+Findit::Application.initialize!
View
35 config/environments/development.rb
@@ -1,17 +1,26 @@
-# Settings specified here will take precedence over those in config/environment.rb
+Findit::Application.configure do
+ # Settings specified here will take precedence over those in config/environment.rb
-# In the development environment your application's code is reloaded on
-# every request. This slows down response time but is perfect for development
-# since you don't have to restart the webserver when you make code changes.
-config.cache_classes = false
+ # In the development environment your application's code is reloaded on
+ # every request. This slows down response time but is perfect for development
+ # since you don't have to restart the webserver when you make code changes.
+ config.cache_classes = false
-# Log error messages when you accidentally call methods on nil.
-config.whiny_nils = true
+ # Log error messages when you accidentally call methods on nil.
+ config.whiny_nils = true
-# Show full error reports and disable caching
-config.action_controller.consider_all_requests_local = true
-config.action_view.debug_rjs = true
-config.action_controller.perform_caching = false
+ # Show full error reports and disable caching
+ config.consider_all_requests_local = true
+ config.action_view.debug_rjs = true
+ config.action_controller.perform_caching = false
+
+ # Don't care if the mailer can't send
+ config.action_mailer.raise_delivery_errors = false
+
+ # Print deprecation notices to the Rails logger
+ config.active_support.deprecation = :log
+
+ # Only use best-standards-support built into browsers
+ config.action_dispatch.best_standards_support = :builtin
+end
-# Don't care if the mailer can't send
-config.action_mailer.raise_delivery_errors = false
View
17 config/environments/development.rb.rails2
@@ -0,0 +1,17 @@
+# Settings specified here will take precedence over those in config/environment.rb
+
+# In the development environment your application's code is reloaded on
+# every request. This slows down response time but is perfect for development
+# since you don't have to restart the webserver when you make code changes.
+config.cache_classes = false
+
+# Log error messages when you accidentally call methods on nil.
+config.whiny_nils = true
+
+# Show full error reports and disable caching
+config.action_controller.consider_all_requests_local = true
+config.action_view.debug_rjs = true
+config.action_controller.perform_caching = false
+
+# Don't care if the mailer can't send
+config.action_mailer.raise_delivery_errors = false
View
61 config/environments/production.rb
@@ -1,28 +1,49 @@
-# Settings specified here will take precedence over those in config/environment.rb
+Findit::Application.configure do
+ # Settings specified here will take precedence over those in config/environment.rb
-# The production environment is meant for finished, "live" apps.
-# Code is not reloaded between requests
-config.cache_classes = true
+ # The production environment is meant for finished, "live" apps.
+ # Code is not reloaded between requests
+ config.cache_classes = true
-# Full error reports are disabled and caching is turned on
-config.action_controller.consider_all_requests_local = false
-config.action_controller.perform_caching = true
-config.action_view.cache_template_loading = true
+ # Full error reports are disabled and caching is turned on
+ config.consider_all_requests_local = false
+ config.action_controller.perform_caching = true
-# See everything in the log (default is :info)
-# config.log_level = :debug
+ # Specifies the header that your server uses for sending files
+ config.action_dispatch.x_sendfile_header = "X-Sendfile"
-# Use a different logger for distributed setups
-# config.logger = SyslogLogger.new
+ # For nginx:
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
-# Use a different cache store in production
-# config.cache_store = :mem_cache_store
+ # If you have no front-end server that supports something like X-Sendfile,
+ # just comment this out and Rails will serve the files
-# Enable serving of images, stylesheets, and javascripts from an asset server
-# config.action_controller.asset_host = "http://assets.example.com"
+ # See everything in the log (default is :info)
+ # config.log_level = :debug
-# Disable delivery errors, bad email addresses will be ignored
-# config.action_mailer.raise_delivery_errors = false
+ # Use a different logger for distributed setups
+ # config.logger = SyslogLogger.new
-# Enable threaded mode
-# config.threadsafe!
+ # Use a different cache store in production
+ # config.cache_store = :mem_cache_store
+
+ # Disable Rails's static asset server
+ # In production, Apache or nginx will already do this
+ config.serve_static_assets = false
+
+ # Enable serving of images, stylesheets, and javascripts from an asset server
+ # config.action_controller.asset_host = "http://assets.example.com"
+
+ # Disable delivery errors, bad email addresses will be ignored
+ # config.action_mailer.raise_delivery_errors = false
+
+ # Enable threaded mode
+ # config.threadsafe!
+
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
+ # the I18n.default_locale when a translation can not be found)
+ config.i18n.fallbacks = true
+
+ # Send deprecation notices to registered listeners
+ config.active_support.deprecation = :notify
+end
View
28 config/environments/production.rb.rails2
@@ -0,0 +1,28 @@
+# Settings specified here will take precedence over those in config/environment.rb
+
+# The production environment is meant for finished, "live" apps.
+# Code is not reloaded between requests
+config.cache_classes = true
+
+# Full error reports are disabled and caching is turned on
+config.action_controller.consider_all_requests_local = false
+config.action_controller.perform_caching = true
+config.action_view.cache_template_loading = true
+
+# See everything in the log (default is :info)
+# config.log_level = :debug
+
+# Use a different logger for distributed setups
+# config.logger = SyslogLogger.new
+
+# Use a different cache store in production
+# config.cache_store = :mem_cache_store
+
+# Enable serving of images, stylesheets, and javascripts from an asset server
+# config.action_controller.asset_host = "http://assets.example.com"
+
+# Disable delivery errors, bad email addresses will be ignored
+# config.action_mailer.raise_delivery_errors = false
+
+# Enable threaded mode
+# config.threadsafe!
View
63 config/environments/test.rb
@@ -1,28 +1,35 @@
-# Settings specified here will take precedence over those in config/environment.rb
-
-# The test environment is used exclusively to run your application's
-# test suite. You never need to work with it otherwise. Remember that
-# your test database is "scratch space" for the test suite and is wiped
-# and recreated between test runs. Don't rely on the data there!
-config.cache_classes = true
-
-# Log error messages when you accidentally call methods on nil.
-config.whiny_nils = true
-
-# Show full error reports and disable caching
-config.action_controller.consider_all_requests_local = true
-config.action_controller.perform_caching = false
-config.action_view.cache_template_loading = true
-
-# Disable request forgery protection in test environment
-config.action_controller.allow_forgery_protection = false
-
-# Tell Action Mailer not to deliver emails to the real world.
-# The :test delivery method accumulates sent emails in the
-# ActionMailer::Base.deliveries array.
-config.action_mailer.delivery_method = :test
-
-# Use SQL instead of Active Record's schema dumper when creating the test database.
-# This is necessary if your schema can't be completely dumped by the schema dumper,
-# like if you have constraints or database-specific column types
-# config.active_record.schema_format = :sql
+Findit::Application.configure do
+ # Settings specified here will take precedence over those in config/environment.rb
+
+ # The test environment is used exclusively to run your application's
+ # test suite. You never need to work with it otherwise. Remember that
+ # your test database is "scratch space" for the test suite and is wiped
+ # and recreated between test runs. Don't rely on the data there!
+ config.cache_classes = true
+
+ # Log error messages when you accidentally call methods on nil.
+ config.whiny_nils = true
+
+ # Show full error reports and disable caching
+ config.consider_all_requests_local = true
+ config.action_controller.perform_caching = false
+
+ # Raise exceptions instead of rendering exception templates
+ config.action_dispatch.show_exceptions = false
+
+ # Disable request forgery protection in test environment
+ config.action_controller.allow_forgery_protection = false
+
+ # Tell Action Mailer not to deliver emails to the real world.
+ # The :test delivery method accumulates sent emails in the
+ # ActionMailer::Base.deliveries array.
+ config.action_mailer.delivery_method = :test
+
+ # Use SQL instead of Active Record's schema dumper when creating the test database.
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
+ # like if you have constraints or database-specific column types
+ # config.active_record.schema_format = :sql
+
+ # Print deprecation notices to the stderr
+ config.active_support.deprecation = :stderr
+end
View
4 config/initializers/backtrace_silencers.rb
@@ -3,5 +3,5 @@
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
-# You can also remove all the silencers if you're trying do debug a problem that might steem from framework code.
-# Rails.backtrace_cleaner.remove_silencers!
+# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
+# Rails.backtrace_cleaner.remove_silencers!
View
2 config/initializers/inflections.rb
@@ -1,6 +1,6 @@
# Be sure to restart your server when you modify this file.
-# Add new inflection rules using the following format
+# Add new inflection rules using the following format
# (all these examples are active by default):
# ActiveSupport::Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
View
7 config/initializers/secret_token.rb
@@ -0,0 +1,7 @@
+# Be sure to restart your server when you modify this file.
+
+# Your secret key for verifying the integrity of signed cookies.
+# If you change this key, all old signed cookies will become invalid!
+# Make sure the secret is at least 30 characters and all random,
+# no regular words or you'll be exposed to dictionary attacks.
+Findit::Application.config.secret_token = 'ee13a23433b70bd6e315d771a4448821baa338e080fe89401fe335006aead1e7f03671f9d7f1f2a2a7523815b3436e9b0876c9b1d8b9dd238dbcb90c8ca3731d'
View
11 config/initializers/session_store.rb
@@ -1,15 +1,8 @@
# Be sure to restart your server when you modify this file.
-# Your secret key for verifying cookie session data integrity.
-# If you change this key, all old sessions will become invalid!
-# Make sure the secret is at least 30 characters and all random,
-# no regular words or you'll be exposed to dictionary attacks.
-ActionController::Base.session = {
- :key => '_groupex_session',
- :secret => '05846c8db0c1772c4debbda32a421b81fdb2008f6aa2e813495f8888d6c34007a4c3b38ff1b135a68c4bc7a31e7fe0da1ed6f9935594c308a7fc20c3b5556269'
-}
+Findit::Application.config.session_store :cookie_store, :key => '_findit_session'
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rake db:sessions:create")
-# ActionController::Base.session_store = :active_record_store
+# Findit::Application.config.session_store :active_record_store
View
52 config/initializers/simple_form.rb
@@ -0,0 +1,52 @@
+# Use this setup block to configure all options available in SimpleForm.
+SimpleForm.setup do |config|
+
+ # Components used by the form builder to generate a complete input. You can remove
+ # any of them, change the order, or even add your own components to the stack.
+ # config.components = [ :label_input, :hint, :error ]
+
+ # Default tag used on hints.
+ # config.hint_tag = :span
+
+ # Default tag used on errors.
+ # config.error_tag = :span
+
+ # Method used to tidy up errors.
+ # config.error_method = :first
+
+ # Default tag used for error notification helper.
+ # config.error_notification_tag = :p
+
+ # You can wrap all inputs in a pre-defined tag.
+ # config.wrapper_tag = :div
+
+ # CSS class to add to all wrapper tags.
+ # config.wrapper_class = :input
+
+ # CSS class to add to the wrapper if the field has errors.
+ # config.wrapper_error_class = :field_with_errors
+
+ # How the label text should be generated altogether with the required text.
+ # config.label_text = lambda { |label, required| "#{required} #{label}" }
+
+ # Whether attributes are required by default (or not). Default is true.
+ # config.required_by_default = true
+
+ # Series of attemps to detect a default label method for collection.
+ # config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
+
+ # Series of attemps to detect a default value method for collection.
+ # config.collection_value_methods = [ :id, :to_s ]
+
+ # Collection of methods to detect if a file type was given.
+ # config.file_methods = [ :file?, :public_filename ]
+
+ # Default priority for time_zone inputs.
+ # config.time_zone_priority = nil
+
+ # Default priority for country inputs.
+ # config.country_priority = nil
+
+ # Default size for text inputs.
+ # config.default_input_size = 50
+end
View
11 config/locales/en.yml
@@ -3,14 +3,3 @@
en:
hello: "Hello world"
- web-app-theme:
- save: Save
- cancel: Cancel
- list: List
- edit: Edit
- new: New
- show: Show
- delete: Delete
- confirm: Are you sure?
- created_at: Created at
- all: All
View
24 config/locales/simple_form.en.yml
@@ -0,0 +1,24 @@
+en:
+ simple_form:
+ "yes": 'Yes'
+ "no": 'No'
+ required:
+ text: 'required'
+ mark: '*'
+ # You can uncomment the line below if you need to overwrite the whole required html.
+ # When using html, text and mark won't be used.
+ # html: '<abbr title="required">*</abbr>'
+ error_notification:
+ default_message: "Some errors were found, please take a look:"
+ # Labels and hints examples
+ # labels:
+ # password: 'Password'
+ # user:
+ # new:
+ # email: 'E-mail para efetuar o sign in.'
+ # edit:
+ # email: 'E-mail.'
+ # hints:
+ # username: 'User name to sign in.'
+ # password: 'No special characters, please.'
+
View
98 config/routes.rb
@@ -1,67 +1,75 @@
-ActionController::Routing::Routes.draw do |map|
- map.resources :operating_systems
-
- map.resources :dns_names
-
-
- map.resources :softwares
-
- map.resources :locations
-
- map.resources :buildings
-
- map.resources :items, :collection=>{:add_ip=>:post, :remove_ip=>:get, :remove_dns_name=>:get, :mark_as_inventoried=>:get}
-
- map.resources :ips
- map.root :controller=>"items", :action=>"index", :type=>"Desktop"
-
- map.resources :pages
-
- map.test "test", :controller=>"announcements", :action=>"users"
- map.resources :users, :collection => { :logout => :get}
- map.logout "logout", :controller=>"users", :action=>"logout"
-
- map.resources :announcements
-
- # The priority is based upon order of creation: first created -> highest priority.
+Findit::Application.routes.draw do
+
+
+ resources :operating_systems
+ resources :dns_names
+ resources :softwares
+ resources :locations
+ resources :buildings
+ resources :items, :collection=>{:add_ip=>:post, :remove_ip=>:get, :remove_dns_name=>:get, :mark_as_inventoried=>:get}
+ resources :ips
+ resources :pages
+ resources :users, :collection => { :logout => :get}
+ resources :announcements
+
+
+ root :to=>"items#index", :type=>"Desktop"
+ match "logout", :to=>"users#logout",:as=>"logout"
+ match ':controller(/:action(/:id(.:format)))'
+ # The priority is based upon order of creation:
+ # first created -> highest priority.
# Sample of regular route:
- # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
+ # match 'products/:id' => 'catalog#view'
# Keep in mind you can assign values other than :controller and :action
# Sample of named route:
- # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
+ # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
# This route can be invoked with purchase_url(:id => product.id)
# Sample resource route (maps HTTP verbs to controller actions automatically):
- # map.resources :products
+ # resources :products
# Sample resource route with options:
- # map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }
+ # resources :products do
+ # member do
+ # get 'short'
+ # post 'toggle'
+ # end
+ #
+ # collection do
+ # get 'sold'
+ # end
+ # end
# Sample resource route with sub-resources:
- # map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller
-
+ # resources :products do
+ # resources :comments, :sales
+ # resource :seller
+ # end
+
# Sample resource route with more complex sub-resources
- # map.resources :products do |products|
- # products.resources :comments
- # products.resources :sales, :collection => { :recent => :get }
+ # resources :products do
+ # resources :comments
+ # resources :sales do
+ # get 'recent', :on => :collection
+ # end
# end
# Sample resource route within a namespace:
- # map.namespace :admin do |admin|
- # # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
- # admin.resources :products
+ # namespace :admin do
+ # # Directs /admin/products/* to Admin::ProductsController
+ # # (app/controllers/admin/products_controller.rb)
+ # resources :products
# end
- # You can have the root of your site routed with map.root -- just remember to delete public/index.html.
- # map.root :controller => "welcome"
+ # You can have the root of your site routed with "root"
+ # just remember to delete public/index.html.
+ # root :to => "welcome#index"
# See how all your routes lay out with "rake routes"
- # Install the default routes as the lowest priority.
- # Note: These default routes make all actions in every controller accessible via GET requests. You should
- # consider removing or commenting them out if you're using named routes and resources.
- map.connect ':controller/:action/:id'
- map.connect ':controller/:action/:id.:format'
+ # This is a legacy wild controller route that's not recommended for RESTful applications.
+ # Note: This route will make all actions in every controller accessible via GET requests.
+
end
View
67 config/routes.rb.rails2
@@ -0,0 +1,67 @@
+ActionController::Routing::Routes.draw do |map|
+ map.resources :operating_systems
+
+ map.resources :dns_names
+
+
+ map.resources :softwares
+
+ map.resources :locations
+
+ map.resources :buildings
+
+ map.resources :items, :collection=>{:add_ip=>:post, :remove_ip=>:get, :remove_dns_name=>:get, :mark_as_inventoried=>:get}
+
+ map.resources :ips
+ map.root :controller=>"items", :action=>"index", :type=>"Desktop"
+
+ map.resources :pages
+
+ map.test "test", :controller=>"announcements", :action=>"users"
+ map.resources :users, :collection => { :logout => :get}
+ map.logout "logout", :controller=>"users", :action=>"logout"
+
+ map.resources :announcements
+
+ # The priority is based upon order of creation: first created -> highest priority.
+
+ # Sample of regular route:
+ # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
+ # Keep in mind you can assign values other than :controller and :action
+
+ # Sample of named route:
+ # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
+ # This route can be invoked with purchase_url(:id => product.id)
+
+ # Sample resource route (maps HTTP verbs to controller actions automatically):
+ # map.resources :products
+
+ # Sample resource route with options:
+ # map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }
+
+ # Sample resource route with sub-resources:
+ # map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller
+
+ # Sample resource route with more complex sub-resources
+ # map.resources :products do |products|
+ # products.resources :comments
+ # products.resources :sales, :collection => { :recent => :get }
+ # end
+
+ # Sample resource route within a namespace:
+ # map.namespace :admin do |admin|
+ # # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
+ # admin.resources :products
+ # end
+
+ # You can have the root of your site routed with map.root -- just remember to delete public/index.html.
+ # map.root :controller => "welcome"
+
+ # See how all your routes lay out with "rake routes"
+
+ # Install the default routes as the lowest priority.
+ # Note: These default routes make all actions in every controller accessible via GET requests. You should
+ # consider removing or commenting them out if you're using named routes and resources.
+ map.connect ':controller/:action/:id'
+ map.connect ':controller/:action/:id.:format'
+end
View
BIN db/development.sqlite3
Binary file not shown.
View
4 db/seeds.rb
@@ -2,6 +2,6 @@
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
-#
+#
# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
-# Major.create(:name => 'Daley', :city => cities.first)
+# Mayor.create(:name => 'Daley', :city => cities.first)
View
BIN db/test.sqlite3
Binary file not shown.
View
2 doc/README_FOR_APP.rails2
@@ -0,0 +1,2 @@
+Use this README file to introduce your application and point to useful places in the API for learning more.
+Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries.
View
0 lib/tasks/.gitkeep
No changes.
View
23 lib/templates/erb/scaffold/_form.html.erb
@@ -0,0 +1,23 @@
+<%%= simple_form_for(@<%= singular_name %>) do |f| %>
+ <%% if @<%= singular_name %>.errors.any? %>
+ <div id="error_explanation">
+ <h2><%%= pluralize(@<%= singular_name %>.errors.count, "error") %> prohibited this <%= singular_name %> from being saved:</h2>
+
+ <ul>
+ <%% @<%= singular_name %>.errors.full_messages.each do |msg| %>
+ <li><%%= msg %></li>
+ <%% end %>
+ </ul>
+ </div>
+ <%% end %>
+
+ <div class="inputs">
+ <%- attributes.each do |attribute| -%>
+ <%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> %>
+ <%- end -%>
+ </div>
+
+ <div class="actions">
+ <%%= f.button :submit %>
+ </div>
+<%% end %>
View
113,490 log/development.log
2,361 additions, 111,129 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
37,857 log/test.log
680 additions, 37,177 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
34 public/404.html
@@ -1,23 +1,19 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-
+<!DOCTYPE html>
+<html>
<head>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>The page you were looking for doesn't exist (404)</title>
- <style type="text/css">
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
- div.dialog {
- width: 25em;
- padding: 0 4em;
- margin: 4em auto 0 auto;
- border: 1px solid #ccc;
- border-right-color: #999;
- border-bottom-color: #999;
- }
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
- </style>
+ <style type="text/css">
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
+ div.dialog {
+ width: 25em;
+ padding: 0 4em;
+ margin: 4em auto 0 auto;
+ border: 1px solid #ccc;
+ border-right-color: #999;
+ border-bottom-color: #999;
+ }
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
+ </style>
</head>
<body>
@@ -27,4 +23,4 @@
<p>You may have mistyped the address or the page may have moved.</p>
</div>
</body>
-</html>
+</html>
View
34 public/422.html
@@ -1,23 +1,19 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-
+<!DOCTYPE html>
+<html>
<head>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>The change you wanted was rejected (422)</title>
- <style type="text/css">
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
- div.dialog {
- width: 25em;
- padding: 0 4em;
- margin: 4em auto 0 auto;
- border: 1px solid #ccc;
- border-right-color: #999;
- border-bottom-color: #999;
- }
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
- </style>
+ <style type="text/css">
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
+ div.dialog {
+ width: 25em;
+ padding: 0 4em;
+ margin: 4em auto 0 auto;
+ border: 1px solid #ccc;
+ border-right-color: #999;
+ border-bottom-color: #999;
+ }
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
+ </style>
</head>
<body>
@@ -27,4 +23,4 @@
<p>Maybe you tried to change something you didn't have access to.</p>
</div>
</body>
-</html>
+</html>
View
32 public/500.html
@@ -1,23 +1,19 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-
+<!DOCTYPE html>
+<html>
<head>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>We're sorry, but something went wrong (500)</title>
- <style type="text/css">
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
- div.dialog {
- width: 25em;
- padding: 0 4em;
- margin: 4em auto 0 auto;
- border: 1px solid #ccc;
- border-right-color: #999;
- border-bottom-color: #999;
- }
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
- </style>
+ <style type="text/css">
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
+ div.dialog {
+ width: 25em;
+ padding: 0 4em;
+ margin: 4em auto 0 auto;
+ border: 1px solid #ccc;
+ border-right-color: #999;
+ border-bottom-color: #999;
+ }
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
+ </style>
</head>
<body>
View
8 public/javascripts/controls.js
@@ -1,6 +1,8 @@
-// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
-// (c) 2005-2008 Ivan Krstic (http://blogs.law.harvard.edu/ivan)
-// (c) 2005-2008 Jon Tirsen (http://www.tirsen.com)
+// script.aculo.us controls.js v1.8.3, Thu Oct 08 11:23:33 +0200 2009
+
+// Copyright (c) 2005-2009 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
+// (c) 2005-2009 Ivan Krstic (http://blogs.law.harvard.edu/ivan)
+// (c) 2005-2009 Jon Tirsen (http://www.tirsen.com)
// Contributors:
// Richard Livsey
// Rahul Bhargava
View
13 public/javascripts/dragdrop.js
@@ -1,5 +1,6 @@
-// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
-// (c) 2005-2008 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz)
+// script.aculo.us dragdrop.js v1.8.3, Thu Oct 08 11:23:33 +0200 2009
+
+// Copyright (c) 2005-2009 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
//
// script.aculo.us is freely distributable under the terms of an MIT-style license.
// For details, see the script.aculo.us web site: http://script.aculo.us/
@@ -311,7 +312,7 @@ var Draggable = Class.create({
tag_name=='TEXTAREA')) return;
var pointer = [Event.pointerX(event), Event.pointerY(event)];
- var pos = Position.cumulativeOffset(this.element);
+ var pos = this.element.cumulativeOffset();
this.offset = [0,1].map( function(i) { return (pointer[i] - pos[i]) });
Draggables.activate(this);
@@ -454,7 +455,7 @@ var Draggable = Class.create({
},
draw: function(point) {
- var pos = Position.cumulativeOffset(this.element);
+ var pos = this.element.cumulativeOffset();
if(this.options.ghosting) {
var r = Position.realOffset(this.element);
pos[0] += r[0] - Position.deltaX; pos[1] += r[1] - Position.deltaY;
@@ -730,7 +731,7 @@ var Sortable = {
}
// keep reference
- this.sortables[element.id] = options;
+ this.sortables[element.identify()] = options;
// for onupdate
Draggables.addObserver(new SortableObserver(element, options.onUpdate));
@@ -825,7 +826,7 @@ var Sortable = {
hide().addClassName('dropmarker').setStyle({position:'absolute'});
document.getElementsByTagName("body").item(0).appendChild(Sortable._marker);
}
- var offsets = Position.cumulativeOffset(dropon);
+ var offsets = dropon.cumulativeOffset();
Sortable._marker.setStyle({left: offsets[0]+'px', top: offsets[1] + 'px'});
if(position=='after')
View
21 public/javascripts/effects.js
@@ -1,4 +1,6 @@
-// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
+// script.aculo.us effects.js v1.8.3, Thu Oct 08 11:23:33 +0200 2009
+
+// Copyright (c) 2005-2009 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// Contributors:
// Justin Palmer (http://encytemedia.com/)
// Mark Pilgrim (http://diveintomark.org/)