6 | <% obj.errors.full_messages.each do |msg| %>
7 |
8 | <%= msg %>
9 |
10 | <% end %>
11 |
12 |
13 |
14 | <% end %>
--------------------------------------------------------------------------------
/config/initializers/backtrace_silencers.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5 |
6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7 | # Rails.backtrace_cleaner.remove_silencers!
8 |
--------------------------------------------------------------------------------
/config/routes.rb:
--------------------------------------------------------------------------------
1 | Rails.application.routes.draw do
2 | root 'pages#home'
3 | get '/home', to: 'pages#home'
4 | post '/home', to: 'pages#create'
5 | get '/logout', to: 'pages#destroy'
6 |
7 | resources :companies do
8 | member do
9 | post 'like'
10 | get '/likes', to: 'companies#user_likes'
11 | end
12 | end
13 |
14 | resources :users, except: [:new,:index, :destroy]
15 | get '/register', to: 'users#new'
16 |
17 | resources :branches, only: [:new, :create, :show]
18 |
19 |
20 | end
21 |
--------------------------------------------------------------------------------
/config/initializers/assets.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Version of your assets, change this if you want to expire all your assets.
4 | Rails.application.config.assets.version = '1.0'
5 |
6 | # Add additional assets to the asset load path
7 | # Rails.application.config.assets.paths << Emoji.images_path
8 |
9 | # Precompile additional assets.
10 | # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
11 | # Rails.application.config.assets.precompile += %w( search.js )
12 |
--------------------------------------------------------------------------------
/bin/spring:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 |
3 | # This file loads spring without using Bundler, in order to be fast.
4 | # It gets overwritten when you run the `spring binstub` command.
5 |
6 | unless defined?(Spring)
7 | require 'rubygems'
8 | require 'bundler'
9 |
10 | if (match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m))
11 | Gem.paths = { 'GEM_PATH' => [Bundler.bundle_path.to_s, *Gem.path].uniq.join(Gem.path_separator) }
12 | gem 'spring', match[1]
13 | require 'spring/binstub'
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/app/views/branches/_form.html.erb:
--------------------------------------------------------------------------------
1 | <%= render 'shared/errors', obj: @branch %>
2 |
3 |
12 |
--------------------------------------------------------------------------------
/config/initializers/wrap_parameters.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # This file contains settings for ActionController::ParamsWrapper which
4 | # is enabled by default.
5 |
6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7 | ActiveSupport.on_load(:action_controller) do
8 | wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9 | end
10 |
11 | # To enable root element in JSON for ActiveRecord objects.
12 | # ActiveSupport.on_load(:active_record) do
13 | # self.include_root_in_json = true
14 | # end
15 |
--------------------------------------------------------------------------------
/README.rdoc:
--------------------------------------------------------------------------------
1 | == README
2 |
3 | This README would normally document whatever steps are necessary to get the
4 | application up and running.
5 |
6 | Things you may want to cover:
7 |
8 | * Ruby version
9 |
10 | * System dependencies
11 |
12 | * Configuration
13 |
14 | * Database creation
15 |
16 | * Database initialization
17 |
18 | * How to run the test suite
19 |
20 | * Services (job queues, cache servers, search engines, etc.)
21 |
22 | * Deployment instructions
23 |
24 | * ...
25 |
26 |
27 | Please feel free to use a different markup language if you do not plan to run
28 | rake doc:app.
29 |
--------------------------------------------------------------------------------
/config/database.yml:
--------------------------------------------------------------------------------
1 | # SQLite version 3.x
2 | # gem install sqlite3
3 | #
4 | # Ensure the SQLite 3 gem is defined in your Gemfile
5 | # gem 'sqlite3'
6 | #
7 | default: &default
8 | adapter: sqlite3
9 | pool: 5
10 | timeout: 5000
11 |
12 | development:
13 | <<: *default
14 | database: db/development.sqlite3
15 |
16 | # Warning: The database defined as "test" will be erased and
17 | # re-generated from your development database when you run "rake".
18 | # Do not set this db to the same as development or production.
19 | test:
20 | <<: *default
21 | database: db/test.sqlite3
22 |
23 | production:
24 | <<: *default
25 | database: db/production.sqlite3
26 |
--------------------------------------------------------------------------------
/app/views/layouts/_messages.html.erb:
--------------------------------------------------------------------------------
1 | <% flash.each do |message_type,message| %>
2 | <% if message_type === "success" %>
3 |
--------------------------------------------------------------------------------
/config/secrets.yml:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Your secret key is used for verifying the integrity of signed cookies.
4 | # If you change this key, all old signed cookies will become invalid!
5 |
6 | # Make sure the secret is at least 30 characters and all random,
7 | # no regular words or you'll be exposed to dictionary attacks.
8 | # You can use `rake secret` to generate a secure secret key.
9 |
10 | # Make sure the secrets in this file are kept private
11 | # if you're sharing your code publicly.
12 |
13 | development:
14 | secret_key_base: b0c1e5b975e44c760d1e77d6ef5d3bf3c9b482e457b9f6812d423fcaee532a349c11d457a8680e6177b4bcbc38cae18e0feb92943ad124feef4d7d8be917635e
15 |
16 | test:
17 | secret_key_base: 43ff26b6416b8041269c0a36a08b0c90e879750eb29034055b6022445236e9c0adba35b2512cd8fe0d9c43e5df83448566a4b7929741670afb559af65c681c74
18 |
19 | # Do not keep production secrets in the repository,
20 | # instead read values from the environment.
21 | production:
22 | secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
23 |
--------------------------------------------------------------------------------
/config/application.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../boot', __FILE__)
2 |
3 | require 'rails/all'
4 |
5 | # Require the gems listed in Gemfile, including any gems
6 | # you've limited to :test, :development, or :production.
7 | Bundler.require(*Rails.groups)
8 |
9 | module Workspace
10 | class Application < Rails::Application
11 | # Settings in config/environments/* take precedence over those specified here.
12 | # Application configuration should go into files in config/initializers
13 | # -- all .rb files in that directory are automatically loaded.
14 |
15 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
16 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
17 | # config.time_zone = 'Central Time (US & Canada)'
18 |
19 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
20 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
21 | # config.i18n.default_locale = :de
22 |
23 | # Do not swallow errors in after_commit/after_rollback callbacks.
24 | config.active_record.raise_in_transactional_callbacks = true
25 | end
26 | end
27 |
--------------------------------------------------------------------------------
/app/models/company.rb:
--------------------------------------------------------------------------------
1 | class Company < ActiveRecord::Base
2 | belongs_to :user
3 | has_many :likes
4 | has_many :company_branches
5 | has_many :branches, through: :company_branches
6 | validates :user_id, presence: true
7 | validates :companyname, presence: true, length: { minimum: 3 ,maximum: 100 }
8 | validates :location, presence: true, length: { minimum: 5, maximum: 300 }
9 | validates :package, presence: true
10 | validates :description, presence: true, length: {minimum: 10, maximum: 1000 }
11 | mount_uploader :picture, PictureUploader
12 | validate :picture_size
13 |
14 | default_scope -> { order(updated_at: :desc) }
15 |
16 | def count_one_stars
17 | self.likes.where(like: 1).size
18 | end
19 |
20 | def count_two_stars
21 | self.likes.where(like: 2).size
22 | end
23 |
24 | def count_three_stars
25 | self.likes.where(like: 3).size
26 | end
27 |
28 | def count_four_stars
29 | self.likes.where(like: 4).size
30 | end
31 |
32 | def count_five_stars
33 | self.likes.where(like: 5).size
34 | end
35 |
36 | def rating
37 | ((count_one_stars + 2*count_two_stars + 3*count_three_stars + 4*count_four_stars + 5*count_five_stars)/self.likes.size.to_f).round(1)
38 | end
39 |
40 | private
41 | def picture_size
42 | if picture.size > 5.megabytes
43 | errors.add(:picture,"should be less than 5MB")
44 | end
45 | end
46 | end
--------------------------------------------------------------------------------
/app/controllers/users_controller.rb:
--------------------------------------------------------------------------------
1 | class UsersController < ApplicationController
2 |
3 | before_action :set_user, only: [:edit, :update, :show]
4 | before_action :require_same_user, only: [:edit, :update]
5 | before_action :require_user, only: [:show]
6 |
7 | def new
8 | @user = User.new
9 | end
10 |
11 | def create
12 | @user = User.new(user_params)
13 | if @user.save
14 | flash[:success] = "Your Account has been registered successfully!!"
15 | session[:user_id] = @user.id
16 | redirect_to companies_path
17 | else
18 | render 'new'
19 | end
20 | end
21 |
22 | def edit
23 | end
24 |
25 | def update
26 | if @user.update(user_params)
27 | flash[:success] = "Your profile has been updated successfully!"
28 | redirect_to user_path(@user)
29 | else
30 | render 'edit'
31 | end
32 | end
33 |
34 | def show
35 | @companies = @user.companies.paginate(page: params[:page],per_page: 3)
36 | end
37 |
38 | private
39 | def user_params
40 | params.require(:user).permit(:username, :email,:phone, :password, :branch_id)
41 | end
42 |
43 | def set_user
44 | @user = User.find(params[:id])
45 | end
46 |
47 | def require_same_user
48 | if current_user != @user
49 | flash[:danger]="You can only edit your own profile"
50 | redirect_to root_path
51 | end
52 | end
53 |
54 |
55 | end
--------------------------------------------------------------------------------
/public/500.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | We're sorry, but something went wrong (500)
5 |
6 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
We're sorry, but something went wrong.
62 |
63 |
If you are the application owner check the logs for more information.
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/config/environments/development.rb:
--------------------------------------------------------------------------------
1 | Rails.application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb.
3 |
4 | # In the development environment your application's code is reloaded on
5 | # every request. This slows down response time but is perfect for development
6 | # since you don't have to restart the web server when you make code changes.
7 | config.cache_classes = false
8 |
9 | # Do not eager load code on boot.
10 | config.eager_load = false
11 |
12 | # Show full error reports and disable caching.
13 | config.consider_all_requests_local = true
14 | config.action_controller.perform_caching = false
15 |
16 | # Don't care if the mailer can't send.
17 | config.action_mailer.raise_delivery_errors = false
18 |
19 | # Print deprecation notices to the Rails logger.
20 | config.active_support.deprecation = :log
21 |
22 | # Raise an error on page load if there are pending migrations.
23 | config.active_record.migration_error = :page_load
24 |
25 | # Debug mode disables concatenation and preprocessing of assets.
26 | # This option may cause significant delays in view rendering with a large
27 | # number of complex assets.
28 | config.assets.debug = true
29 |
30 | # Asset digests allow you to set far-future HTTP expiration dates on all assets,
31 | # yet still be able to expire them through the digest params.
32 | config.assets.digest = true
33 |
34 | # Adds additional error checking when serving assets at runtime.
35 | # Checks for improperly declared sprockets dependencies.
36 | # Raises helpful error messages.
37 | config.assets.raise_runtime_errors = true
38 |
39 | # Raises error for missing translations
40 | # config.action_view.raise_on_missing_translations = true
41 | end
42 |
--------------------------------------------------------------------------------
/public/422.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | The change you wanted was rejected (422)
5 |
6 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
The change you wanted was rejected.
62 |
Maybe you tried to change something you didn't have access to.
63 |
64 |
If you are the application owner check the logs for more information.
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/public/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | The page you were looking for doesn't exist (404)
5 |
6 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
The page you were looking for doesn't exist.
62 |
You may have mistyped the address or the page may have moved.
63 |
64 |
If you are the application owner check the logs for more information.
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/app/uploaders/picture_uploader.rb:
--------------------------------------------------------------------------------
1 | # encoding: utf-8
2 |
3 | class PictureUploader < CarrierWave::Uploader::Base
4 |
5 | include CarrierWave::MiniMagick
6 | process resize_to_limit: [600,600]
7 |
8 | # Include RMagick or MiniMagick support:
9 | # include CarrierWave::RMagick
10 |
11 |
12 | # Choose what kind of storage to use for this uploader:
13 |
14 | if Rails.env.production?
15 | storage :fog
16 | else
17 | storage :file
18 | end
19 |
20 | # storage :fog
21 |
22 | # Override the directory where uploaded files will be stored.
23 | # This is a sensible default for uploaders that are meant to be mounted:
24 | def store_dir
25 | "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
26 | end
27 |
28 | # Provide a default URL as a default if there hasn't been a file uploaded:
29 | # def default_url
30 | # # For Rails 3.1+ asset pipeline compatibility:
31 | # # ActionController::Base.helpers.asset_path("fallback/" + [version_name, "default.png"].compact.join('_'))
32 | #
33 | # "/images/fallback/" + [version_name, "default.png"].compact.join('_')
34 | # end
35 |
36 | # Process files as they are uploaded:
37 | # process :scale => [200, 300]
38 | #
39 | # def scale(width, height)
40 | # # do something
41 | # end
42 |
43 | # Create different versions of your uploaded files:
44 | # version :thumb do
45 | # process :resize_to_fit => [50, 50]
46 | # end
47 |
48 | # Add a white list of extensions which are allowed to be uploaded.
49 | # For images you might use something like this:
50 | def extension_white_list
51 | %w(jpg jpeg gif png)
52 | end
53 |
54 | # Override the filename of the uploaded files:
55 | # Avoid using model.id or version_name here, see uploader/store.rb for details.
56 | # def filename
57 | # "something.jpg" if original_filename
58 | # end
59 |
60 | end
--------------------------------------------------------------------------------
/app/views/companies/_form.html.erb:
--------------------------------------------------------------------------------
1 | <%= render 'shared/errors', obj: @company %>
2 |
3 |
32 |
33 |
--------------------------------------------------------------------------------
/config/environments/test.rb:
--------------------------------------------------------------------------------
1 | Rails.application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb.
3 |
4 | # The test environment is used exclusively to run your application's
5 | # test suite. You never need to work with it otherwise. Remember that
6 | # your test database is "scratch space" for the test suite and is wiped
7 | # and recreated between test runs. Don't rely on the data there!
8 | config.cache_classes = true
9 |
10 | # Do not eager load code on boot. This avoids loading your whole application
11 | # just for the purpose of running a single test. If you are using a tool that
12 | # preloads Rails for running tests, you may have to set it to true.
13 | config.eager_load = false
14 |
15 | # Configure static file server for tests with Cache-Control for performance.
16 | config.serve_static_files = true
17 | config.static_cache_control = 'public, max-age=3600'
18 |
19 | # Show full error reports and disable caching.
20 | config.consider_all_requests_local = true
21 | config.action_controller.perform_caching = false
22 |
23 | # Raise exceptions instead of rendering exception templates.
24 | config.action_dispatch.show_exceptions = false
25 |
26 | # Disable request forgery protection in test environment.
27 | config.action_controller.allow_forgery_protection = false
28 |
29 | # Tell Action Mailer not to deliver emails to the real world.
30 | # The :test delivery method accumulates sent emails in the
31 | # ActionMailer::Base.deliveries array.
32 | config.action_mailer.delivery_method = :test
33 |
34 | # Randomize the order test cases are executed.
35 | config.active_support.test_order = :random
36 |
37 | # Print deprecation notices to the stderr.
38 | config.active_support.deprecation = :stderr
39 |
40 | # Raises error for missing translations
41 | # config.action_view.raise_on_missing_translations = true
42 | end
43 |
--------------------------------------------------------------------------------
/db/schema.rb:
--------------------------------------------------------------------------------
1 | # encoding: UTF-8
2 | # This file is auto-generated from the current state of the database. Instead
3 | # of editing this file, please use the migrations feature of Active Record to
4 | # incrementally modify your database, and then regenerate this schema definition.
5 | #
6 | # Note that this schema.rb definition is the authoritative source for your
7 | # database schema. If you need to create the application database on another
8 | # system, you should be using db:schema:load, not running all the migrations
9 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10 | # you'll amass, the slower it'll run and the greater likelihood for issues).
11 | #
12 | # It's strongly recommended that you check this file into your version control system.
13 |
14 | ActiveRecord::Schema.define(version: 20161120185511) do
15 |
16 | create_table "branches", force: :cascade do |t|
17 | t.string "name"
18 | end
19 |
20 | create_table "companies", force: :cascade do |t|
21 | t.string "companyname"
22 | t.date "date"
23 | t.string "location"
24 | t.float "package"
25 | t.text "description"
26 | t.datetime "created_at"
27 | t.datetime "updated_at"
28 | t.integer "user_id"
29 | t.string "picture"
30 | end
31 |
32 | create_table "company_branches", force: :cascade do |t|
33 | t.integer "company_id"
34 | t.integer "branch_id"
35 | end
36 |
37 | create_table "likes", force: :cascade do |t|
38 | t.integer "like"
39 | t.integer "user_id"
40 | t.integer "company_id"
41 | end
42 |
43 | create_table "users", force: :cascade do |t|
44 | t.string "username"
45 | t.string "email"
46 | t.string "phone"
47 | t.boolean "admin", default: false
48 | t.datetime "created_at"
49 | t.datetime "updated_at"
50 | t.string "password_digest"
51 | t.integer "branch_id"
52 | end
53 |
54 | end
55 |
--------------------------------------------------------------------------------
/app/views/layouts/_navigationWithoutLogin.html.erb:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 
2 |
3 | # PlaceMentor
4 | :mortar_board: PlaceMentor helps you to get information regarding Oncampus companies visit!
5 | Designed for Jamians only
6 | PlaceMentor is currently hosting on [Heroku](http://placementor.herokuapp.com/)
7 |
8 |
9 | ### Technologies used
10 |
11 | This website uses a number of open source projects to work properly:
12 |
13 | * Frontend
14 | * HTML/CSS
15 | * Bootstrap
16 |
17 | * Backend
18 | * Ruby/Rails
19 | * AWS
20 |
21 |
22 | ### Development
23 |
24 | Want to contribute? **:pencil:**
25 |
26 | To fix a bug or enhance an existing module, follow these steps:
27 |
28 | 1. Fork the repo
29 | 2. Create a new branch (`git checkout -b exciting-stuff`)
30 | 3. Make the appropriate changes in the files
31 | 4. Add changes to reflect the changes made
32 | 5. Commit your changes (`git commit -am 'exciting-stuff!!'`)
33 | 6. Push to the branch (`git push origin exciting-stuff`)
34 | 7. Create a Pull Request
35 |
36 | ### Interested?
37 |
38 | If you find a bug (the website couldn't handle the query and / or gave irrelevant results), kindly open an issue [here](https://github.com/thegenuinegourav/PlaceMentor/issues/new) by including your search query and the expected result.
39 |
40 | If you'd like to request a new functionality, feel free to do so by opening an issue [here](https://github.com/thegenuinegourav/PlaceMentor/issues/new) including some sample queries and their corresponding results.
41 |
42 | ### Screenshots
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/app/views/layouts/_navigation.html.erb:
--------------------------------------------------------------------------------
1 |
49 |
50 |
--------------------------------------------------------------------------------
/app/controllers/companies_controller.rb:
--------------------------------------------------------------------------------
1 | require 'mini_magick'
2 | class CompaniesController < ApplicationController
3 |
4 | before_action :set_company, only: [:edit,:update,:like, :show, :user_likes]
5 | before_action :require_user, except: [:like]
6 | before_action :require_user_likes, only: [:like]
7 | before_action :require_admin, except: [:index, :show, :like, :user_likes]
8 | before_action :require_same_user, only: [:edit, :update]
9 |
10 |
11 | def index
12 | @companies = Company.paginate(page: params[:page],per_page: 3)
13 | end
14 |
15 | def show
16 |
17 | end
18 |
19 | def new
20 | @company = Company.new
21 | end
22 |
23 | def create
24 | @company = Company.new(company_params)
25 | @company.user = current_user
26 |
27 | if @company.save
28 | flash[:success] = "Created Successfully!"
29 | redirect_to companies_path
30 | else
31 | render :new
32 | end
33 |
34 | end
35 |
36 | def edit
37 |
38 | end
39 |
40 | def update
41 |
42 | if @company.update(company_params)
43 | flash[:success] = "Updated Successfully!"
44 | redirect_to company_path(@company)
45 | else
46 | render :edit
47 | end
48 | end
49 |
50 | def like
51 |
52 | like = Like.create(like: params[:like], user: current_user, company: @company)
53 | if like.valid?
54 | flash[:success] = "You reviewed this company!"
55 | else
56 | flash[:danger] = "You can only reviewed this company once!"
57 | end
58 | redirect_to likes_company_path(@company)
59 | end
60 |
61 | def user_likes
62 |
63 | end
64 |
65 | private
66 | def company_params
67 | params.require(:company).permit(:companyname,:date,:location,:package,:description,:picture,branch_ids: [])
68 | end
69 |
70 | def set_company
71 | @company = Company.find(params[:id])
72 | end
73 |
74 | def require_same_user
75 | if current_user != @company.user
76 | flash[:danger] = "You can only edit your own provided company info"
77 | redirect_to companies_path
78 | end
79 | end
80 |
81 | def require_user_likes
82 | if !logged_in?
83 | flash[:danger] = "You must be logged in to perform this action!"
84 | redirect_to :back
85 | end
86 | end
87 |
88 | def require_admin
89 | if !current_user.admin?
90 | flash[:danger] = "You must be an admin to perform this action!"
91 | redirect_to companies_path
92 | end
93 | end
94 | end
--------------------------------------------------------------------------------
/app/views/companies/show.html.erb:
--------------------------------------------------------------------------------
1 |
71 |
72 |
--------------------------------------------------------------------------------
/config/environments/production.rb:
--------------------------------------------------------------------------------
1 | Rails.application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb.
3 |
4 | # Code is not reloaded between requests.
5 | config.cache_classes = true
6 |
7 | # Eager load code on boot. This eager loads most of Rails and
8 | # your application in memory, allowing both threaded web servers
9 | # and those relying on copy on write to perform better.
10 | # Rake tasks automatically ignore this option for performance.
11 | config.eager_load = true
12 |
13 | # Full error reports are disabled and caching is turned on.
14 | config.consider_all_requests_local = false
15 | config.action_controller.perform_caching = true
16 |
17 | # Enable Rack::Cache to put a simple HTTP cache in front of your application
18 | # Add `rack-cache` to your Gemfile before enabling this.
19 | # For large-scale production use, consider using a caching reverse proxy like
20 | # NGINX, varnish or squid.
21 | # config.action_dispatch.rack_cache = true
22 |
23 | # Disable serving static files from the `/public` folder by default since
24 | # Apache or NGINX already handles this.
25 | config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
26 |
27 | # Compress JavaScripts and CSS.
28 | config.assets.js_compressor = :uglifier
29 | # config.assets.css_compressor = :sass
30 |
31 | # Do not fallback to assets pipeline if a precompiled asset is missed.
32 | config.assets.compile = true
33 | config.serve_static_files = true
34 |
35 | # Asset digests allow you to set far-future HTTP expiration dates on all assets,
36 | # yet still be able to expire them through the digest params.
37 | config.assets.digest = true
38 |
39 | # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
40 |
41 | # Specifies the header that your server uses for sending files.
42 | # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
43 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
44 |
45 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
46 | # config.force_ssl = true
47 |
48 | # Use the lowest log level to ensure availability of diagnostic information
49 | # when problems arise.
50 | config.log_level = :debug
51 |
52 | # Prepend all log lines with the following tags.
53 | # config.log_tags = [ :subdomain, :uuid ]
54 |
55 | # Use a different logger for distributed setups.
56 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
57 |
58 | # Use a different cache store in production.
59 | # config.cache_store = :mem_cache_store
60 |
61 | # Enable serving of images, stylesheets, and JavaScripts from an asset server.
62 | # config.action_controller.asset_host = 'http://assets.example.com'
63 |
64 | # Ignore bad email addresses and do not raise email delivery errors.
65 | # Set this to true and configure the email server for immediate delivery to raise delivery errors.
66 | # config.action_mailer.raise_delivery_errors = false
67 |
68 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
69 | # the I18n.default_locale when a translation cannot be found).
70 | config.i18n.fallbacks = true
71 |
72 | # Send deprecation notices to registered listeners.
73 | config.active_support.deprecation = :notify
74 |
75 | # Use default logging formatter so that PID and timestamp are not suppressed.
76 | config.log_formatter = ::Logger::Formatter.new
77 |
78 | # Do not dump schema after migrations.
79 | config.active_record.dump_schema_after_migration = false
80 | end
81 |
--------------------------------------------------------------------------------
/app/views/companies/user_likes.html.erb:
--------------------------------------------------------------------------------
1 | div style="padding-top: 50px;">
2 | <%= render 'layouts/navigationWithoutLogin' %>
3 |
4 |
5 |
6 |
7 |
Ratings for <%= link_to @company.companyname,company_path(@company) %>