Skip to content

Commit 1bd432f

Browse files
committed
Add remote to opportunity
1 parent 18de2d5 commit 1bd432f

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

app/controllers/opportunities_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def edit
2929
end
3030

3131
def create
32-
opportunity_create_params = params.require(:opportunity).permit(:name, :team_id, :opportunity_type, :description, :tags, :location, :link, :salary, :apply)
32+
opportunity_create_params = params.require(:opportunity).permit(:name, :team_id, :opportunity_type, :description, :tags, :location, :link, :salary, :apply, :remote)
3333
@job = Opportunity.new(opportunity_create_params)
3434
respond_to do |format|
3535
if @job.save

app/views/opportunities/_form.html.haml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030
=j.label :location, 'Specify the city/location where the candidate must be located'
3131
=j.text_field :location
3232

33+
%fieldset
34+
=j.label :remote do
35+
=j.check_box :remote
36+
Allow remote
37+
3338
%fieldset
3439
=j.label :link, 'Link to full job posting on your career site (ex: http://example.com/career)'
3540
=j.text_field :link
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class AddRemoteToOpportunity < ActiveRecord::Migration
2+
def change
3+
add_column :opportunities, :remote, :boolean
4+
end
5+
end

db/schema.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#
1212
# It's strongly recommended to check this file into your version control system.
1313

14-
ActiveRecord::Schema.define(:version => 20141111082038) do
14+
ActiveRecord::Schema.define(:version => 20141221211825) do
1515

1616
add_extension "citext"
1717
add_extension "hstore"
@@ -211,6 +211,7 @@
211211
t.boolean "apply", :default => false
212212
t.string "public_id"
213213
t.integer "team_id"
214+
t.boolean "remote"
214215
end
215216

216217
create_table "pictures", :force => true do |t|

0 commit comments

Comments
 (0)