Skip to content

Instantly share code, notes, and snippets.

@aya-soft
Created May 27, 2016 20:45
Show Gist options
  • Save aya-soft/f89f2c1a950467f16f3ccfd0e770af5d to your computer and use it in GitHub Desktop.
Save aya-soft/f89f2c1a950467f16f3ccfd0e770af5d to your computer and use it in GitHub Desktop.
1) @spare.number нужно заменить на @comment.spare.number 2) hidden_field убрать СРОЧНО!!! его можно легко подделать
%h1 Редактировать комментарий об установки детали № #{@spare.number}
%h2 Сервисный центр #{@comment.service_station.name}
= simple_form_for [:admin, @comment], :html => { id: "comment_form", class: "form-horizontal", role: "form" } do |f|
= f.hidden_field :spare_id, value: @spare.id
= f.input :time_of_installing_current_part, label: "Ориентировочное время установки (ч.)"
= f.input :installing_current_part_price, label: "Стоимость установки (р.)"
= f.input :comment, label: "Комментарий", as: :text
.form-group
.col-sm-offset-3.col-sm-9
= f.submit "Сохранить", class: "btn btn-primary"
= link_to "Отмена", :back, class: "btn btn-default"
@romhi
Copy link

romhi commented May 30, 2016

Сделал

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment