Skip to content

Commit ce17796

Browse files
committed
Fix editing/adding locations
Fix the forms, remove unused routes for locations. + Fix annotations in routes.rb
1 parent 616d08c commit ce17796

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

app/views/opportunities/_form.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
%fieldset
2525
-if @team.locations.any?
2626
=j.label :location do
27-
== Select one or more locations where the candidate must be located or #{link_to('add/manage team locations', edit_team_locations_path(@team))}
27+
== Select one or more locations where the candidate must be located or #{link_to('add/manage team locations', teamname_edit_path(slug: @team.slug, anchor: "locations"))}
2828
=j.select(:location, @team.cities+["anywhere"], {selected: (@job.location.blank? ? [] : @job.location.split("|"))}, {multiple: true})
2929
-else
3030
=j.label :location, 'Specify the city/location where the candidate must be located'

app/views/teams/_locations.html.haml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313
.add-map-location= link_to_add_fields('Add new location', f, :locations)
1414
-if @team.has_locations?
1515
.location-list
16-
= f.fields_for :team_locations do |fields|
16+
= f.fields_for :locations do |fields|
1717
.item
18-
= fields.hidden_field :id
1918
%fieldset
2019
= fields.label :name, 'Location Name'
2120
= fields.text_field :name

config/routes.rb

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# == Route Map
22
#
3-
# GET /.json(.:format) #<Proc:0x00000009e29dd0@/home/vagrant/web/config/routes.rb:270>
4-
# GET /teams/.json(.:format) #<Proc:0x00000009e32750@/home/vagrant/web/config/routes.rb:271>
3+
# GET /.json(.:format) #<Proc:0x00000008e12370@/home/vagrant/web/config/routes.rb:270>
4+
# GET /teams/.json(.:format) #<Proc:0x00000008e324e0@/home/vagrant/web/config/routes.rb:271>
55
# /mail_view MailPreview
66
# protips_update GET|PUT /protips/update(.:format) protips#update
77
# protip_update GET|PUT /protip/update(.:format) protip#update
@@ -139,13 +139,6 @@
139139
# team_member GET /teams/:team_id/members/:id(.:format) members#show
140140
# PUT /teams/:team_id/members/:id(.:format) members#update
141141
# DELETE /teams/:team_id/members/:id(.:format) members#destroy
142-
# team_locations GET /teams/:team_id/locations(.:format) locations#index
143-
# POST /teams/:team_id/locations(.:format) locations#create
144-
# new_team_location GET /teams/:team_id/locations/new(.:format) locations#new
145-
# edit_team_location GET /teams/:team_id/locations/:id/edit(.:format) locations#edit
146-
# team_location GET /teams/:team_id/locations/:id(.:format) locations#show
147-
# PUT /teams/:team_id/locations/:id(.:format) locations#update
148-
# DELETE /teams/:team_id/locations/:id(.:format) locations#destroy
149142
# apply_team_opportunity POST /teams/:team_id/opportunities/:id/apply(.:format) opportunities#apply
150143
# activate_team_opportunity GET /teams/:team_id/opportunities/:id/activate(.:format) opportunities#activate
151144
# deactivate_team_opportunity GET /teams/:team_id/opportunities/:id/deactivate(.:format) opportunities#deactivate
@@ -405,7 +398,7 @@
405398
get 'search'
406399
end
407400
resources :members
408-
resources :locations, as: :locations
401+
409402
resources :opportunities do
410403
member do
411404
post 'apply'

0 commit comments

Comments
 (0)