Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- has_one :scope
- accepts_nested_attributes_for :scope
- belongs_to :project
- has_one :participant
- accepts_nested_attributes_for :participant,
- belongs_to :scope
- has_one :address
- accepts_nested_attributes_for :address
- belongs_to :participant
- <%= f.simple_fields_for :participant do |partadd_p| %>
- <%= partadd_p.simple_fields_for :address do |partadd| %>
- <div class="row">
- <div class="col-md-3 col-md-offset-1">
- <%= partadd.label 'Select participation location', :class => 'question-project' %>
- </div>
- <div class="col-md-7">
- <div class="response-project">
- <%= partadd.input :participant_country, priority: ["AU", "NZ", "GB", "US"], label: false %>
- <%= render 'addresses/partform', f: f %>
- <div id="participationrequest" style="display:none">
- <%= render 'participants/form', f: f %>
- </div>
- <% if @project.scope.try(:if_participant) == true %>
- <%= render 'participants/particulars'%>
- <% end %>
- <% if @project.scope.participant.location_specific == true %>
- <%= @project.scope.participant.address.participation_country %>
- <% else %>
- <%= render :text => "Remote participation" %>
- <% end %>
- undefined method `participation_country' for nil:NilClass
- <%= @project.scope.try(:participant).try(:address).try(:participation_country) %>
- def new
- @participant = Participant.new
- @participant.address = Address.new
- end
- @project.scope.participant = Participant.new
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement