2015-10-03 08:04:16 -05:00
|
|
|
%h2= @parent.name
|
2015-10-04 20:27:03 -05:00
|
|
|
|
|
|
|
%ul.sub-nav
|
|
|
|
%li= link_to 'back', :back
|
|
|
|
%li= link_to 'edit', edit_parent_path(@parent)
|
|
|
|
|
2015-10-03 08:04:16 -05:00
|
|
|
%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
|
2015-10-03 19:16:46 -05:00
|
|
|
= link_to child.name, child_path(child)
|
2015-10-03 08:57:06 -05:00
|
|
|
= link_to 'remove', del_parenthood_path(@parent, child), method: :delete
|
2015-10-03 08:04:16 -05:00
|
|
|
|
|
|
|
%p Add Child:
|
2015-10-03 15:15:19 -05:00
|
|
|
= 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'
|