Skip to content

Instantly share code, notes, and snippets.

View grayontheweb's full-sized avatar

Gray Sutherland grayontheweb

View GitHub Profile
@grayontheweb
grayontheweb / searchform
Created January 19, 2015 20:42
yunowerk
#searchForm{:role => "search"}
%select#searchPath
%option{:'data-action' => '/properties/search'}=t('.residential')
%option{:'data-action' => '/residential/rentals'}=t('.rentals')
%option{:'data-action' => '/vacation_rentals'}=t('.vacation_rentals')
%option{:'data-action' => '/lots_and_land'}=t('.lots_and_land')
%option{:'data-action' => '/communities'}=t('.communities')
%form#search{ :action => "/properties/search", :method => "get" }
.fields
@grayontheweb
grayontheweb / gist:dbae9fb907971fc07ca2
Created January 19, 2015 20:44
yunowerkthesequel
var $searchForm = $('#search'),
$searchPath = $searchForm.find('#searchPath');
$searchPath.change(function() {
$searchForm.attr('action', $(this).find('option:selected').data('action'));
});
$searchForm.submit(function (event) {
// code
event.preventDefault();