remove input field from admin/resource#index
This commit is contained in:
parent
3065766da9
commit
6db2e8abe7
2 changed files with 5 additions and 21 deletions
|
|
@ -16,17 +16,15 @@
|
||||||
%tbody
|
%tbody
|
||||||
- @conference.resources.each do |resource|
|
- @conference.resources.each do |resource|
|
||||||
%tr
|
%tr
|
||||||
=semantic_form_for(resource, url: admin_conference_resource_path(@conference.short_title, resource.id), html: { method: :put }) do |f|
|
%td
|
||||||
%td
|
= link_to(admin_conference_resource_path(@conference.short_title, resource.id)) do
|
||||||
= link_to(admin_conference_resource_path(@conference.short_title, resource.id)) do
|
= resource.name
|
||||||
= resource.name
|
|
||||||
%td
|
%td
|
||||||
= quantity_left_of(resource)
|
= quantity_left_of(resource)
|
||||||
%td.col-sm-1.col-md-1
|
%td
|
||||||
= f.input :used, label: false
|
= resource.used
|
||||||
%td
|
%td
|
||||||
.btn-group
|
.btn-group
|
||||||
= f.action :submit, as: :button, label: 'Save', button_html: { class: 'btn btn-success' }
|
|
||||||
= link_to 'Edit', edit_admin_conference_resource_path(@conference.short_title, resource.id),
|
= link_to 'Edit', edit_admin_conference_resource_path(@conference.short_title, resource.id),
|
||||||
method: :get, class: 'btn btn-primary', disabled: !(can? :update, resource)
|
method: :get, class: 'btn btn-primary', disabled: !(can? :update, resource)
|
||||||
= link_to 'Delete', admin_conference_resource_path(@conference.short_title, resource.id),
|
= link_to 'Delete', admin_conference_resource_path(@conference.short_title, resource.id),
|
||||||
|
|
|
||||||
|
|
@ -43,19 +43,5 @@ feature Resource do
|
||||||
|
|
||||||
expect(flash).to eq('Resource successfully destroyed.')
|
expect(flash).to eq('Resource successfully destroyed.')
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'on admin/resources#index' do
|
|
||||||
|
|
||||||
scenario 'update an existing resource' do
|
|
||||||
visit admin_conference_resources_path(conference.short_title)
|
|
||||||
fill_in 'resource_used', with: 7
|
|
||||||
|
|
||||||
click_button 'Save'
|
|
||||||
resource.reload
|
|
||||||
|
|
||||||
expect(flash).to eq('Resource successfully updated.')
|
|
||||||
expect(resource.used).to eq(7)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue