19 lines
576 B
Plaintext
19 lines
576 B
Plaintext
%h2= @child.name
|
|
%p= link_to 'edit', edit_child_path(@child)
|
|
|
|
- unless @child.parents.empty?
|
|
%p Parents:
|
|
%ul
|
|
- @child.parents.each do |parent|
|
|
%li
|
|
= link_to parent.name, parent_path(parent)
|
|
= link_to 'remove', del_parenthood_path(parent, @child), method: :delete
|
|
|
|
%p Add Parent:
|
|
= form_tag add_parent_to_child_path(@child) do
|
|
:ruby
|
|
select_options = options_from_collection_for_select(@parents, :id, :name)
|
|
html_options = { include_blank: true }
|
|
= select_tag(:parent, select_options, html_options)
|
|
= submit_tag 'Add Parent to Child'
|