Last active
December 23, 2015 00:09
-
-
Save jparbros/6551339 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # views/surveys/_form.html.erb | |
| <%= form_for @survey do |f| %> | |
| <p> | |
| <%= f.label :name %><br /> | |
| <%= f.text_field :name %> | |
| </p> | |
| <p><%= f.submit "Submit" %></p> | |
| <% end %> |
This file contains hidden or 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
| # == Schema Info | |
| # | |
| # Table name: answers | |
| # | |
| # id :integer | |
| # content :text | |
| # created_at :datetime | |
| # updated_at :datetime | |
| # | |
| class Answer < ActiveRecord::Base | |
| belongs_to :question | |
| end |
This file contains hidden or 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
| # == Schema Info | |
| # | |
| # Table name: surveys | |
| # | |
| # id :integer | |
| # content :text | |
| # created_at :datetime | |
| # updated_at :datetime | |
| # | |
| class Question < ActiveRecord::Base | |
| belongs_to :survey | |
| has_many :answers, :dependent => :destroy | |
| end |
This file contains hidden or 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
| # == Schema Info | |
| # | |
| # Table name: surveys | |
| # | |
| # id :integer | |
| # name :string | |
| # created_at :datetime | |
| # updated_at :datetime | |
| # | |
| class Survey < ActiveRecord::Base | |
| has_many :questions, :dependent => :destroy | |
| end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment