Skip to content

Instantly share code, notes, and snippets.

@jdkealy
Created November 1, 2011 18:29
Show Gist options
  • Save jdkealy/1331460 to your computer and use it in GitHub Desktop.
Save jdkealy/1331460 to your computer and use it in GitHub Desktop.
#FORM
%fieldset#organization{:style => "display:none"}
%h3
Organization
= f.fields_for :organisations do |org|
.row
.span5
= org.input :name, :label => "<strong>Name of the Organization</strong>"
.span5
//= org.input :title, :label => "Your role"
.row
.span10
= org.input :description, :as => :text, :label => "Description of the organization", :hint => "Give us a short description of your company or organizaiton."
.row
= org.link_to_remove "Remove this oranisation"
= f.link_to_add "Add an organisation", :organisations
%hr.prof_bar
#profile
class Profile < ActiveRecord::Base
has_many :memberships
has_many :organisations, :through => :memberships
#organisations
class Organisation < ActiveRecord::Base
has_many :memberships
has_many :members, :through => :memberships
#membership
class Membership < ActiveRecord::Base
belongs_to :organisation
belongs_to :profile
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment