24 lines
716 B
Plaintext
24 lines
716 B
Plaintext
%h2= @parent.name
|
|
%p= link_to 'edit', edit_parent_path(@parent)
|
|
%p Email: #{mail_to(@parent.email, nil, encode: 'hex')}
|
|
%p Phone: #{number_to_phone @parent.phone} #{page_link(@parent)}
|
|
|
|
- unless @parent.children.empty?
|
|
%p Children:
|
|
%ul
|
|
- @parent.children.each do |child|
|
|
%li
|
|
= child.name
|
|
= link_to 'remove', del_parenthood_path(@parent, child), method: :delete
|
|
|
|
%p Add Child:
|
|
= form_tag add_parenthood_path(@parent) do
|
|
:ruby
|
|
select_options = options_from_collection_for_select(@more_children, :id, :name)
|
|
html_options = {
|
|
include_blank: true,
|
|
data: { id: 'children' }
|
|
}
|
|
= select_tag(:child, select_options, html_options)
|
|
= submit_tag 'Add Child to Parent'
|