Created
September 13, 2012 16:46
-
-
Save telagraphic/3715699 to your computer and use it in GitHub Desktop.
devise
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Day < ActiveRecord::Base | |
attr_accessible :sleep, :wake | |
has_one :habit, :dependent => :destroy | |
belongs_to :user | |
end | |
class Habit < ActiveRecord::Base | |
belongs_to :day | |
attr_accessible :energy, :mood, :overall | |
end | |
class User < ActiveRecord::Base | |
# Include default devise modules. Others available are: | |
# :token_authenticatable, :confirmable, | |
# :lockable, :timeoutable and :omniauthable | |
devise :database_authenticatable, :registerable, | |
:recoverable, :rememberable, :trackable, :validatable | |
# Setup accessible (or protected) attributes for your model | |
attr_accessible :email, :password, :password_confirmation, :remember_me | |
# attr_accessible :title, :body | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Life::Application.routes.draw do | |
devise_for :users do | |
resources :days | |
end | |
root :to => "Days#index" | |
resources :days do | |
resources :habits | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment