Commit 5a71084e by nnnghia98

import companies

parent c81913ab
...@@ -14,7 +14,7 @@ $light-gray: #777; ...@@ -14,7 +14,7 @@ $light-gray: #777;
/* universal */ /* universal */
body { body {
padding-top: 30px; padding-top: 90px;
} }
section { section {
...@@ -32,6 +32,33 @@ textarea { ...@@ -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 */ /* header */
/* footer */ /* footer */
...@@ -50,3 +77,13 @@ footer { ...@@ -50,3 +77,13 @@ footer {
} }
} }
} }
/* miscellaneous */
.debug_dump {
clear: both;
float: left;
width: 100%;
margin-top: 45px;
@include box_sizing;
}
class CompaniesController < ApplicationController class CompaniesController < ApplicationController
def index def index
@companies = Company.all
end end
def import def import
Company.companies_import
redirect_to companies_index_path, notice: "Companies imported successful!"
end end
end end
...@@ -19,6 +19,6 @@ class Company < ApplicationRecord ...@@ -19,6 +19,6 @@ class Company < ApplicationRecord
companies << {name: row["company name"], email: row["contact email"], address: row["company address"]} companies << {name: row["company name"], email: row["contact email"], address: row["company address"]}
end end
City.import columns, companies, on_duplicate_key_ignore: true Company.import columns, companies, on_duplicate_key_ignore: true
end end
end end
<h1>Companies#index</h1> <%= flash[:notice] %>
<p>Find me in app/views/companies/index.html.erb</p>
<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"> <div class="container">
<%= link_to image_tag("venjob_logo.png", alt: "VeNJOB Logo") , root_path, id: "logo" %> <%= link_to image_tag("venjob_logo.png", alt: "VeNJOB Logo") , root_path, id: "logo" %>
<nav> <nav>
......
<h1>VeNJOB Top page</h1> <div class="center jumbotron">
<div class="container">
<div class="banner"> <div class="banner">
<img src="banner.png" alt="Banner"> <img src="banner.png" alt="Banner">
</div> </div>
<div class="search"></div> <div class="search"></div>
<div class="lastest_jobs"></div> <div class="lastest_jobs">
<h3>Latest jobs</h3>
</div>
<div class="top_cities"> <div class="top_cities">
<h3>Top cities</h3> <h3>Top cities</h3>
......
Rails.application.routes.draw do Rails.application.routes.draw do
get 'companies/index' get "companies/index"
get 'companies/import' get "companies/import"
resources :companies do
collection {post :import}
end
get "industries/index" get "industries/index"
get "industries/import" get "industries/import"
resources :industries do 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