app/views/crud/users/edit.html.haml
- @title ||= ti(:title, model: full_entry_label).html_safe
- content_for(:actions, render('actions_edit'))
= simple_form_for(@user, method: :put, url: user_path) do |f|
= f.error_notification
.form-inputs
= f.input :first_name
= f.input :last_name
= f.input :phone_number
= f.input :email
= f.input :date_of_birth, as: :string, input_html: { type: :date }
= f.input :place_of_birth
= f.input :role, collection: User::ROLES, include_blank: false
= f.input :status, collection: User::STATUSES, include_blank: false
= f.input :password, required: false
= f.input :password_confirmation, required: false
.btn-group{ role: :group }
= f.button :submit, 'Save', class: 'btn-primary'
= link_to('Back', user_path(@user.id), class: 'btn btn-default')
:javascript
$(function(){
$('input[type=time]').timepicker({
timeFormat: 'HH:mm',
interval: 15,
minTime: '00:00',
maxTime: '23:59',
startTime: '00:00',
dynamic: false,
dropdown: true,
scrollbar: true
}).attr('type','string');
$('input[type=date]').datepicker({
language: '#{I18n.locale}',
format: 'yyyy-mm-dd',
startDate: '1907-10-17',
endDate: '2100-12-31',
todayBtn: true
}).attr('type','string');
nicEditors.allTextAreas();
})