View:
<% form_tag attendances_path, :method => ‘get’ do %>
Search attendances by date: <%= date_select :search, params[:search], :use_short_month => true, :order => [:month, :day, :year] %> <%= submit_tag 'Search', :name => nil %>
<% end %>Model:
def self.search(search, page)
paginate :per_page => 10, :page => page,
:conditions => [‘date like ?’, “%#{search}%”],
:order => ‘date desc’
end
Controller:
def index
@page_title = ‘Attendances’
@attendances = @school.attendances.search(params[:search],
params[:page])
end
Why is this not working? Thanks for any help!