Commit 0a22afec by Đường Sỹ Hoàng

Add params to url

parent a0a457d1
......@@ -10,7 +10,6 @@ class ApplyController < ApplicationController
end
end
def confirm
@apply = current_user.applies.new(apply_job_params)
end
......
......@@ -11,8 +11,12 @@
<%= link_to "Apply Finish", "#" %>
</li>
</ol>
</nav>
<%= form_for(@apply, url: done_path(@job)) do |f|%>
<div class="container">
<div class="d-flex justify-content-center ">
<div class="card">
</nav>
<%= form_for(@apply, url: done_path(@job)) do |f|%>
<div class= "field">
<%= f.label :username %>
</br>
......@@ -49,16 +53,18 @@
</div>
</br>
<div class="field">
<div class = "actions">
<%= f.submit "Done", class: "btn btn-primary" %>
</div>
<% end %>
<div class = "float-right">
<%= link_to "Done", done_path(@job), class: "btn btn-primary" %>
<div class= "action float-right">
<%= link_to "Edit", apply_path(@job, apply: { first_name: @apply.first_name,
last_name: @apply.last_name,
email: @apply.email,
cv_url: @apply.cv_url }), class: "btn btn-primary" %>
</div>
<div class= "float-left">
<%= link_to "Edit", apply_path, class: "btn btn-primary" %>
</div>
<% end %>
</div>
</div>
</div>
......@@ -20,34 +20,28 @@
<h2>Apply Form</h2>
</div>
<%= form_for(@apply, url: confirm_path(@job)) do |f|%>
<div class= "field">
<%= f.label :username %>
</br>
<%= f.text_field :username, autofocus: true, length: 200 %>
</div>
<div class="field">
<%= f.label :first_name %>
</br>
<%= f.text_field :first_name, autofocus: true %>
<%= f.text_field :first_name %>
</div>
<div class="field">
<%= f.label :last_name %>
</br>
<%= f.text_field :last_name, autofocus: true %>
<%= f.text_field :last_name %>
</div>
<div class="field">
<%= f.label :email %>
</br>
<%= f.email_field :email, autofocus: true %>
<%= f.email_field :email %>
</div>
<div class="field">
<%= f.label :CV_URL %>
</br>
<%= f.url_field :cv_url, autofocus: true %>
<%= f.url_field :cv_url %>
</div>
</br>
<div class = "actions">
......
......@@ -49,10 +49,6 @@
<dt class="col-sm-3">Requirement:</dt>
<dd class="col-sm-9"><%= simple_format @job.requirement %></dd>
</dl>
<% if user_signed_in? %>
<%= link_to "Apply", apply_path, class: "btn btn-primary" %>
<% else %>
<%= link_to "Login", login_path, class: "btn btn-primary" %>
<% end %>
</div>
</div
<div class="row align-items-center">
<div class="col text-center">
<%= job.title %>
<%= link_to "#{job.title}", job_path(job.id) %>
</div>
</div>
</br>
class ChangeTypeUserJob < ActiveRecord::Migration[6.0]
def change
rename_column :user_jobs, :job_type, :type
change_column :user_jobs, :type, :string
end
end
......@@ -71,7 +71,7 @@ ActiveRecord::Schema.define(version: 2020_01_15_032331) do
create_table "user_jobs", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
t.integer "user_id"
t.integer "job_id"
t.integer "type"
t.string "type"
t.datetime "favorited_at"
t.datetime "viewed_at"
t.datetime "applied_at"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment