Q:

Simple Search with Rails - Search Results on Separate Page

Im starting out in rails and trying to incorporate a simple search but am only getting so far.
the string looks ok but doesn't seem to execute to the results page. there seems to be a number of issues nil methods, actions missing or routes falling over when I try include restful resources.
I want search on one page (search) and the results to populate to another results page (map).
Both come under the PagesController and are actions within it.
The table is called towns and the user entries and CRUD area it is controlled by the TownsController and has an association with devise User_id.
There is then the pages controller which has search,map,about,contact pages.
class PagesController < ApplicationController

  def index
  end

  def search
    @towns = Town.search(params[:search])
  end

  def page
  end

  def map
  end
end
--------------------------

class Town < ActiveRecord::Base

geocoded_by :name
  after_validation :geocode

  belongs_to :user

def self.search(search)
   if search
     search_condition = "%" + search + "%"
     where(['townName LIKE ? OR townDescription LIKE ?', search_condition, search_condition])
   end
 end

-------------------------

views

search.html.erb

<div class="form-group">
 <%= form_tag(pages_map_path , method: "get") do %>
  <p>
    <%= text_field_tag :search, params[:search], class: 'search-text' %>
    <%= submit_tag "Search", :name => nil, class: 'btn btn-primary btn-lg'%>
  </p>
<% end %>

results  --> to map page

map.html.erb

<ul>
    <% @towns.each do |town| %>
  <li><%= link_to town.name,
    :action => 'map', :id => town.id  %></li>
  <% end %>
</ul>

---------------------------
routes
Rails.application.routes.draw do
devise_for :users

get "pages/search"
get "pages/index"
get "pages/contact"
get "pages/about"
get "pages/map"
get "pages/page"

match ':controller(/:action(/:id))', :via => [:get, :post]

root 'pages#search'

end

A:

Solution:
Column names in search query were incorrect 
townName LIKE ? OR townDescription should be =  name LIKE ? OR description 

updated results page call to:
<ul>
    <% @towns.each do |town| %>
  <h2><li><%= link_to @name, controller: 'towns', :action => 'show', :id => town.id  %></li></h2>
  <% end %>
</ul>

