This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ObserveForm = Class.create({ | |
initialize: function() { | |
this.form = $('form_id'); | |
this.form.observe('submit', this.submitForm.bindAsEventListener(this)); | |
this.data_area = $('display_area'); | |
}, | |
submitForm: function(event) { | |
event.stop(); | |
this.form.request({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Company < ActiveRecord::Base | |
# Sunspot/Solr search indexing | |
searchable do | |
string :name | |
text :profile | |
integer :media_type_id | |
integer :sector_type_id, :multiple => true do | |
sectors.map {|sector| sector.sector_type_id} | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def search_results | |
search = Company.search do | |
keywords 'belfast marketing' | |
with(:sector_type_id).any_of [1, 2, 4, 8] | |
paginate :page => page_number, :per_page => 30 | |
order_by :name, :asc | |
end | |
@results = search.results | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h2>Your results</h2> | |
<% unless @results.nil? %> | |
<table> | |
<tr> | |
<th>company</th> | |
<th>profile</th> | |
</tr> | |
<% for result_item in @results %> | |
<tr class="<%= cycle('odd', 'even') %>"> | |
<td><%= result_item.name %></td> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
common: &common | |
solr: | |
hostname: localhost | |
port: 8983 | |
production: | |
<<: *common | |
solr: | |
path: /data/solr/myapp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ***** Roast Theme | |
!base_color_1 = #2D1E1E | |
!base_color_2 = #4B3C37 | |
!base_color_1_light = !base_color_1 + #212121 | |
!base_color_1_lighter = !base_color_1 + #444444 | |
!base_color_1_dark = !base_color_1 - #111111 | |
!base_color_2_light = !base_color_2 + #212121 | |
!base_color_2_lighter = !base_color_2 + #444444 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ***** Raindrop Theme | |
!base_color_1 = #1C1D21 | |
!base_color_2 = #31353D | |
!base_color_1_light = !base_color_1 + #212121 | |
!base_color_1_lighter = !base_color_1 + #444444 | |
!base_color_1_dark = !base_color_1 - #111111 | |
!base_color_2_light = !base_color_2 + #212121 | |
!base_color_2_lighter = !base_color_2 + #444444 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ***** Ruby Theme | |
!base_color_1 = #212121 | |
!base_color_2 = #660000 | |
!base_color_1_light = !base_color_1 + #212121 | |
!base_color_1_lighter = !base_color_1 + #444444 | |
!base_color_1_dark = !base_color_1 - #111111 | |
!base_color_2_light = !base_color_2 + #212121 | |
!base_color_2_lighter = !base_color_2 + #444444 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
post.comments.sort_by(&:created_at) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
post.comments.sort_by(&:created_at).reverse |