I've been trying (unsuccessfully so far) to use the out of the box in-form sorting provided by the ransack gem, and the result of it unfortunately is an empty form.
Here's what I've done so far:
Controller:
class LandingController < ApplicationController
layout "landing2"
def index
@zones = Zone.all
@zone_id ||= 1
@q = Property.search(params[:q])
@q.build_sort if @q.sorts.empty?
end
end
View (partial):
<%= search_form_for @q, :url => home_path, :html => { :method => :get } do |f| %>
<%= f.sort_fields do |s| %>
<%= s.sort_select %>
<% end %>
<%= f.submit "Sort" %>
<% end %>
And the result is:
Does anybody know what could possibly be wrong?
Thanks for all the help!