Last active
September 8, 2015 15:48
-
-
Save soilforlifeforms/463f6b0db0166cc71d6e to your computer and use it in GitHub Desktop.
js issue
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
<%= form_for([@group, @gardener, @garden]) do |g| %> | |
<div class="panel panel-default"> | |
<%= render "shared/error_messages", :target => @garden %> | |
<h3> Garden information </h3> | |
<%= g.fields_for :physical_info do |pi| %> | |
<div class="field" > | |
<%= pi.label :at_home, "Is the garden located at home" %> <br/> | |
<%= pi.radio_button :at_home, wrapper_html: {id: "at_home"} %> | |
<%= pi.label :at_home, "Yes" %> | |
</div> | |
<div class="address"> | |
<%= pi.label :address, "If the garden is not located at home what is the address of the garden?" %> | |
<%= pi.text_field :address, wrapper_html: {id: "address"} %> | |
</div> | |
<% end %> | |
<div class="form-actions"> | |
<%= g.submit 'continue', :class => 'btn btn-lg btn-success' %> | |
</div> | |
</div> | |
<% 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
class Garden <ActiveRecord::Base | |
belongs_to :gardener | |
has_one :physical_info | |
accepts_nested_attributes_for :physical_info | |
has_many :pictures | |
accepts_nested_attributes_for :pictures | |
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
$(function() { | |
$('input[id=at_home]').on('click init-at_home', function() { | |
$('#address').toggle($('#at_home').prop('checked')); | |
}).trigger('init-at_home'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment