Commit b31a4f53 by nnnghia98

import companies

parent 722477b2
......@@ -14,7 +14,7 @@ $light-gray: #777;
/* universal */
body {
padding-top: 30px;
padding-top: 90px;
}
section {
......@@ -32,6 +32,33 @@ textarea {
}
}
/* typography */
h1, h2, h3, h4, h5, h6 {
line-height: 1;
}
h1 {
font-size: 3em;
letter-spacing: -2px;
margin-bottom: 30px;
text-align: center;
}
h2 {
font-size: 1.2em;
letter-spacing: -1px;
margin-bottom: 30px;
text-align: center;
font-weight: normal;
color: $light-gray;
}
p {
font-size: 1.1em;
line-height: 1.7em;
}
/* header */
/* footer */
......@@ -50,3 +77,13 @@ footer {
}
}
}
/* miscellaneous */
.debug_dump {
clear: both;
float: left;
width: 100%;
margin-top: 45px;
@include box_sizing;
}
class CompaniesController < ApplicationController
def index
@companies = Company.all
end
def import
Company.companies_import
redirect_to companies_index_path, notice: "Companies imported successful!"
end
end
......@@ -19,6 +19,6 @@ class Company < ApplicationRecord
companies << {name: row["company name"], email: row["contact email"], address: row["company address"]}
end
City.import columns, companies, on_duplicate_key_ignore: true
Company.import columns, companies, on_duplicate_key_ignore: true
end
end
<h1>Companies#index</h1>
<p>Find me in app/views/companies/index.html.erb</p>
<%= flash[:notice] %>
<table class="table">
<thead>
<tr>
<th scope="col">company name</th>
<th scope="col">contact email</th>
<th scope="col">company address</th>
</tr>
</thead>
<tbody>
<% @companies.each do |company| %>
<tr>
<td><%= company.name %></td>
<td><%= company.email %></td>
<td><%= company.address %></td>
</tr>
<% end %>
</tbody>
</table>
<header class="navbar navbar-fixed-top navbar-inverse navbar-dark bg-dark">
<header class="navbar fixed-top navbar-dark bg-dark">
<div class="container">
<%= link_to image_tag("venjob_logo.png", alt: "VeNJOB Logo") , root_path, id: "logo" %>
<nav>
......
......@@ -8,7 +8,9 @@
<div class="search"></div>
<div class="lastest_jobs"></div>
<div class="lastest_jobs">
<h3>Latest jobs</h3>
</div>
<div class="top_cities">
<h3>Top cities</h3>
......
Rails.application.routes.draw do
get 'companies/index'
get 'companies/import'
get "companies/index"
get "companies/import"
resources :companies do
collection {post :import}
end
get "industries/index"
get "industries/import"
resources :industries do
......
,nghiann,devops-OptiPlex-3020,29.11.2019 16:15,file:///home/nghiann/.config/libreoffice/4;
\ No newline at end of file
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