Filtering index using has_many through relationships
In models/job.rb, you can add scopes and use them chained on the controller:

class Job &lt; ActiveRecord::Model
  scope :with_cities, -&gt;(city) { includes(:cities).where(cities: { id: @city })  if city }
  scope :with_positions, -&gt;(position) { includes(:positions).where(positions: { id: @position }) if position }

  # rest of the code ...
end




For JobsController, you can:


Add a before_filter to load all the data, and if you need to use that data on other actions, you just need to append the name of that action too.
Use memoization to load the city and the position. 


In controllers/jobs_controller.rb:

class JobsController &lt; ApplicationController
  before_filter :load_data, only: [:index]

  def index
    @jobs = Job.with_cities(city).with_positions(position).paginate(page: params[:page], per_page: 5)
  end

  # ...

  protected:

  def load_data
    @cities = City.all
    @positions = Position.all
  end

  def city
    @city ||= City.find(params[:city_id]) unless params[:city_id].empty?
  end

  def position
    @position ||= Position.find(params[:position_id]) unless params[:position_id].empty?
  end




On the view:

Use try, so instead of:

    - if current_user &amp;&amp; current_user.admin? 
      == render 'shared/dashboard_header' 


you could write:

    == render 'shared/dashboard_header' if current_user.try(:admin?)


Use include_blank and prompt options in select_tag. 
This not only simplifies the views, but also allows to use params[city_id].empty? on the controller.

select_tag :city_id, 
  options_from_collection_for_select(@cities, :id, :name, params[:city_id].to_i), 
    include_blank: true, prompt: "all cities...", class: "basic" 


Finally, you could extract ul.jobs into a partial:

= render partial: 'jobs', locals: { jobs: @jobs }


Or even the .job_search div, especially if you'll be needing this somewhere else.