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

Add params to url

parent a0a457d1
...@@ -10,7 +10,6 @@ class ApplyController < ApplicationController ...@@ -10,7 +10,6 @@ class ApplyController < ApplicationController
end end
end end
def confirm def confirm
@apply = current_user.applies.new(apply_job_params) @apply = current_user.applies.new(apply_job_params)
end end
......
...@@ -11,8 +11,12 @@ ...@@ -11,8 +11,12 @@
<%= link_to "Apply Finish", "#" %> <%= link_to "Apply Finish", "#" %>
</li> </li>
</ol> </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"> <div class= "field">
<%= f.label :username %> <%= f.label :username %>
</br> </br>
...@@ -49,16 +53,18 @@ ...@@ -49,16 +53,18 @@
</div> </div>
</br> </br>
<div class="field">
<div class = "actions"> <div class = "actions">
<%= f.submit "Done", class: "btn btn-primary" %> <%= f.submit "Done", class: "btn btn-primary" %>
</div> </div>
<% end %> <div class= "action float-right">
<div class = "float-right"> <%= link_to "Edit", apply_path(@job, apply: { first_name: @apply.first_name,
<%= link_to "Done", done_path(@job), class: "btn btn-primary" %> last_name: @apply.last_name,
email: @apply.email,
cv_url: @apply.cv_url }), class: "btn btn-primary" %>
</div> </div>
</div>
<div class= "float-left"> <% end %>
<%= link_to "Edit", apply_path, class: "btn btn-primary" %>
</div> </div>
</div> </div>
</div> </div>
...@@ -20,34 +20,28 @@ ...@@ -20,34 +20,28 @@
<h2>Apply Form</h2> <h2>Apply Form</h2>
</div> </div>
<%= form_for(@apply, url: confirm_path(@job)) do |f|%> <%= 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"> <div class="field">
<%= f.label :first_name %> <%= f.label :first_name %>
</br> </br>
<%= f.text_field :first_name, autofocus: true %> <%= f.text_field :first_name %>
</div> </div>
<div class="field"> <div class="field">
<%= f.label :last_name %> <%= f.label :last_name %>
</br> </br>
<%= f.text_field :last_name, autofocus: true %> <%= f.text_field :last_name %>
</div> </div>
<div class="field"> <div class="field">
<%= f.label :email %> <%= f.label :email %>
</br> </br>
<%= f.email_field :email, autofocus: true %> <%= f.email_field :email %>
</div> </div>
<div class="field"> <div class="field">
<%= f.label :CV_URL %> <%= f.label :CV_URL %>
</br> </br>
<%= f.url_field :cv_url, autofocus: true %> <%= f.url_field :cv_url %>
</div> </div>
</br> </br>
<div class = "actions"> <div class = "actions">
......
...@@ -49,10 +49,6 @@ ...@@ -49,10 +49,6 @@
<dt class="col-sm-3">Requirement:</dt> <dt class="col-sm-3">Requirement:</dt>
<dd class="col-sm-9"><%= simple_format @job.requirement %></dd> <dd class="col-sm-9"><%= simple_format @job.requirement %></dd>
</dl> </dl>
<% if user_signed_in? %>
<%= link_to "Apply", apply_path, class: "btn btn-primary" %> <%= link_to "Apply", apply_path, class: "btn btn-primary" %>
<% else %>
<%= link_to "Login", login_path, class: "btn btn-primary" %>
<% end %>
</div> </div>
</div </div
<div class="row align-items-center"> <div class="row align-items-center">
<div class="col text-center"> <div class="col text-center">
<%= job.title %> <%= link_to "#{job.title}", job_path(job.id) %>
</div> </div>
</div> </div>
</br> </br>
class ChangeTypeUserJob < ActiveRecord::Migration[6.0] class ChangeTypeUserJob < ActiveRecord::Migration[6.0]
def change def change
rename_column :user_jobs, :job_type, :type rename_column :user_jobs, :job_type, :type
change_column :user_jobs, :type, :string
end end
end end
...@@ -71,7 +71,7 @@ ActiveRecord::Schema.define(version: 2020_01_15_032331) do ...@@ -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| create_table "user_jobs", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
t.integer "user_id" t.integer "user_id"
t.integer "job_id" t.integer "job_id"
t.integer "type" t.string "type"
t.datetime "favorited_at" t.datetime "favorited_at"
t.datetime "viewed_at" t.datetime "viewed_at"
t.datetime "applied_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