Skip to content
This repository has been archived by the owner on May 14, 2022. It is now read-only.

Commit

Permalink
fixes library_id problem
Browse files Browse the repository at this point in the history
  • Loading branch information
sdellis committed Jun 14, 2016
1 parent a4d5b91 commit d51470a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 0 additions & 2 deletions app/models/locations/floor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@ class Floor < ActiveRecord::Base
include Locations::Labeled
include Locations::WithLibrary

belongs_to :holding_library, class_name: 'Locations::Library', foreign_key: :holding_library_id

end
end
8 changes: 8 additions & 0 deletions app/views/locations/floors/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@
<%= f.label :walkable_areas %><br>
<%= f.text_field :walkable_areas %>
</div>

<div class="form-group">
<%= f.label 'Library', class: 'col-sm-2 control-label'%>
<div class="col-sm-10">
<%= f.collection_select :locations_library_id, Locations::Library.all, :id, :label, {prompt: "Select a Library"}, {class: "form-control"} %>
</div>
</div>

<div class="actions">
<%= f.submit %>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class AddLocationsLibraryToLocationsFloors < ActiveRecord::Migration
def change
add_reference :locations_floors, :locations_libraries, index: true, foreign_key: true
add_reference :locations_floors, :locations_library, index: true, foreign_key: true
end
end

0 comments on commit d51470a

Please sign in to comment.