Skip to content

Instantly share code, notes, and snippets.

@JonasNielsen
Created March 23, 2010 16:09
Show Gist options
  • Save JonasNielsen/341336 to your computer and use it in GitHub Desktop.
Save JonasNielsen/341336 to your computer and use it in GitHub Desktop.
class Designer < ActiveRecord::Base
has_one :login, :as => :user, :dependent => :destroy
accepts_nested_attributes_for :login
end
- # VIEW FOR ADDING A NEW DESIGNER
%h1 New Designer
- form_for(@designer) do |f|
- f.fields_for :login do |login|
= login.label :email
%br/
= login.text_field :email
%br/
= login.label :password
%br/
= login.password_field :password
%br/
= login.label :password_confirmation
%br/
= login.password_field :password_confirmation
class Users < ActiveRecord::Base
belongs_to :user, :polymorphic => true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment