Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

conform to the generated app produced by Rails 3.0.0.rc

  • Loading branch information...
commit 27b26ce86846c7be4a8c10407c82f4dbeeff51f8 1 parent aab54c8
Daniel Kehoe authored
39 Gemfile
View
@@ -1,8 +1,37 @@
source 'http://rubygems.org'
gem 'rails', '3.0.0.rc'
-gem 'mongoid', '2.0.0.beta.15'
-gem 'bson_ext', '1.0.4'
-gem 'devise', '1.1.1'
-# uncomment if you wish to deploy to Heroku
-# gem 'heroku', '1.9.12'
+
+# 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', '1.4.1'
+# # 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
+
+# Bundle gems needed for Mongoid
+gem "mongoid", "2.0.0.beta.15"
+gem "bson_ext", "1.0.4"
+
+# Bundle gem needed for Devise
+gem "devise", "1.1.1"
2  Rakefile
View
@@ -4,4 +4,4 @@
require File.expand_path('../config/application', __FILE__)
require 'rake'
-Rails::Application.load_tasks
+Rails3MongoidDevise::Application.load_tasks
2  app/controllers/users_controller.rb
View
@@ -5,5 +5,5 @@ def show
@user = User.find(params[:id])
end
-
+
end
4 app/models/user.rb
View
@@ -1,6 +1,5 @@
class User
include Mongoid::Document
-
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable, :lockable and :timeoutable
devise :database_authenticatable, :registerable,
@@ -9,4 +8,5 @@ class User
field :name
validates_presence_of :name
validates_uniqueness_of :name, :email, :case_sensitive => false
-end
+end
+
2  app/views/devise/menu/_login_items.html.erb
View
@@ -6,4 +6,4 @@
<li>
<%= link_to('Login', new_user_session_path) %>
</li>
-<% end %>
+<% end %>
2  app/views/devise/menu/_registration_items.html.erb
View
@@ -6,4 +6,4 @@
<li>
<%= link_to('Sign up', new_user_registration_path) %>
</li>
-<% end %>
+<% end %>
2  app/views/home/index.html.erb
View
@@ -2,4 +2,4 @@
<p>Find me in app/views/home/index.html.erb</p>
<% @users.each do |user| %>
<p>User: <%=link_to user.name, user %></p>
-<% end %>
+<% end %>
40 config/application.rb
View
@@ -1,7 +1,7 @@
require File.expand_path('../boot', __FILE__)
-# If you are deploying to Heroku and MongoHQ, you'll need to
-# supply connection information here.
+# If you are deploying to Heroku and MongoHQ,
+# you supply connection information here.
require 'uri'
if ENV['MONGOHQ_URL']
mongo_uri = URI.parse(ENV['MONGOHQ_URL'])
@@ -18,21 +18,47 @@
require 'active_resource/railtie'
require 'rails/test_unit/railtie'
+
# 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 Rails3MongoidDevise
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.generators do |g|
- g.orm :mongoid
- end
+ # 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)
+
+ config.generators do |g|
+ g.orm :mongoid
+ end
+
+ # Configure the default encoding used in templates for Ruby 1.9.
- # 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, :password_confirmation]
end
-end
+end
4 config/environments/development.rb
View
@@ -21,8 +21,8 @@
config.action_mailer.perform_deliveries = false
config.action_mailer.raise_delivery_errors = true
config.action_mailer.default :charset => "utf-8"
-
-
+
+
# Print deprecation notices to the Rails logger
config.active_support.deprecation = :log
end
2  config/environments/production.rb
View
@@ -43,7 +43,7 @@
# 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
-
+
config.action_mailer.default_url_options = { :host => 'yourhost.com' }
### ActionMailer Config
# Setup for production - deliveries, no errors raised
2  config/environments/test.rb
View
@@ -29,7 +29,7 @@
# 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
35 config/initializers/devise.rb
View
@@ -9,8 +9,9 @@
# config.mailer = "Devise::Mailer"
# ==> ORM configuration
- # Load and configure the ORM. Supports :active_record (default), :mongoid
- # (bson_ext recommended) and :data_mapper (experimental).
+ # Load and configure the ORM. Supports :active_record (default) and
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
+ # available as additional gems.
require 'devise/orm/mongoid'
# ==> Configuration for any authentication mechanism
@@ -27,6 +28,9 @@
# Tell if authentication through HTTP Basic Auth is enabled. True by default.
# config.http_authenticatable = true
+ # Set this to true to use Basic Auth for AJAX requests. True by default.
+ # config.http_authenticatable_on_xhr = true
+
# The realm used in Http Basic Authentication
# config.http_authentication_realm = "Application"
@@ -42,7 +46,7 @@
config.encryptor = :bcrypt
# Setup a pepper to generate the encrypted password.
- config.pepper = "5049f5610eb83718b98d1d1e926df8e31d1537012626869d8a4bc20915c586cb479f2be229e538d339870784af4aa9fd0ba9a6297258edffe788ae03eba5720b"
+ config.pepper = "5206ffa6a6c1718b88a6570faa50eade0e969d643c5f0b1163226f06e54cc4e6df858511a4b688cb0ad4b5c681a6c5d09ef498f7c81e5bfaf67afcf7e5f746ad"
# ==> Configuration for :confirmable
# The time you want to give your user to confirm his account. During this time
@@ -57,6 +61,12 @@
# The time the user will be remembered without asking for credentials again.
# config.remember_for = 2.weeks
+ # If true, a valid remember token can be re-used between multiple browsers.
+ # config.remember_across_browsers = true
+
+ # If true, extends the user's remember period when remembered via cookie.
+ # config.extend_remember_period = false
+
# ==> Configuration for :validatable
# Range for password length
# config.password_length = 6..20
@@ -95,22 +105,19 @@
# ==> Scopes configuration
# Turn scoped views on. Before rendering "sessions/new", it will first check for
- # "sessions/users/new". It's turned off by default because it's slower if you
+ # "users/sessions/new". It's turned off by default because it's slower if you
# are using only default views.
# config.scoped_views = true
- # By default, devise detects the role accessed based on the url. So whenever
- # accessing "/users/sign_in", it knows you are accessing an User. This makes
- # routes as "/sign_in" not possible, unless you tell Devise to use the default
- # scope, setting true below.
- # Note that devise does not generate default routes. You also have to
- # specify them in config/routes.rb
- # config.use_default_scope = true
-
- # Configure the default scope used by Devise. By default it's the first devise
- # role declared in your routes.
+ # Configure the default scope given to Warden. By default it's the first
+ # devise role declared in your routes.
# config.default_scope = :user
+ # Configure sign_out behavior.
+ # By default sign_out is scoped (i.e. /users/sign_out affects only :user scope).
+ # In case of sign_out_all_scopes set to true any logout action will sign out all active scopes.
+ # config.sign_out_all_scopes = false
+
# ==> Navigation configuration
# Lists the formats that should be treated as navigational. Formats like
# :html, should redirect to the sign in page when the user does not have
2  config/initializers/inflections.rb
View
@@ -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'
4 config/initializers/secret_token.rb
View
@@ -2,6 +2,6 @@
# 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,
+# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
-Rails.application.config.secret_token = '16c8e510b2ddb26abc4c3af8c6d920352073df775f6a71c175b5414180955808df9155029aa9dc275805e714454613d1a4d880db1b16b8677cf9fbcea70fa404'
+Rails3MongoidDevise::Application.config.secret_token = '2e16658ee1ca9825515d39fe72725ee4588555485984f7b668c423b16bf5ee9788ee134c715638238f49ae0638c942652e6b624544771d817e81f7810848fd12'
4 config/initializers/session_store.rb
View
@@ -1,8 +1,8 @@
# Be sure to restart your server when you modify this file.
-Rails.application.config.session_store :cookie_store, :key => '_rails3-mongoid-devise_session'
+Rails3MongoidDevise::Application.config.session_store :cookie_store, :key => '_rails3-mongoid-devise_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")
-# Rails.application.config.session_store :active_record_store
+# Rails3MongoidDevise::Application.config.session_store :active_record_store
2  config/routes.rb
View
@@ -1,6 +1,6 @@
Rails3MongoidDevise::Application.routes.draw do
#get \"users\/show\"
-
+
root :to => "home#index"
devise_for :users
Please sign in to comment.
Something went wrong with that request. Please try again.