end move up and down button for type de champ
This commit is contained in:
parent
2d8ffc949d
commit
37b4823e9a
5 changed files with 54 additions and 155 deletions
|
@ -2,11 +2,11 @@
|
|||
class TypeDeChampDecorator < Draper::Decorator
|
||||
delegate_all
|
||||
def button_up params
|
||||
h.button_tag '', class: up_classes, id: "btn_up_#{params[:index]}", remote: true, method: :post if display_up_button?(params[:index])
|
||||
h.link_to '', params[:url], class: up_classes, id: "btn_up_#{params[:index]}", remote: true, method: :post if display_up_button?(params[:index])
|
||||
end
|
||||
|
||||
def button_down params
|
||||
h.button_tag '', class: down_classes, id: "btn_down_#{params[:index]}", remote: true if display_down_button?(params[:index])
|
||||
h.link_to '', params[:url], class: down_classes, id: "btn_down_#{params[:index]}", remote: true, method: :post if display_down_button?(params[:index])
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
- unless ff.object.id.nil?
|
||||
.form-group
|
||||
%br
|
||||
= ff.object.button_up(index: ff.index)
|
||||
= ff.object.button_down(index: ff.index)
|
||||
= ff.object.button_up(index: ff.index, url: move_up_admin_procedure_types_de_champ_path(@procedure, ff.index))
|
||||
= ff.object.button_down(index: ff.index, url: move_down_admin_procedure_types_de_champ_path(@procedure, ff.index))
|
||||
|
||||
|
||||
.form-group
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue